#include <LiquidCrystal.h>
LiquidCrystal lcd(13,12,11,10,9,8);
#define MINUS 3
#define PLUS 4

#define set1(r,b) r|=1<<b
#define set0(r,b) r&=~(1<<b)
int a = 0;

void setup() {
  lcd.begin(16,2);
  set0(DDRD, MINUS);
  set0(DDRD, PLUS);
  set1(PORTD, MINUS);
  set1(PORTD, PLUS);

  set1(SREG,7);
  set1(EIMSK,MINUS);
  set1(EIMSK,PLUS);
  set0(EICRA,0);
  set1(EICRA,1);
  set0(EICRA,2);
  set1(EICRA,3);
}

void loop() {
}


ISR(INT0_vect)
{
lcd.clear();
a++;
lcd.print(a);

}


ISR(INT1_vect)
{
lcd.clear();
a--;
lcd.print(a);
}