#include #include #define INPUT(str) do{char *p;fgets(str,sizeof(str),stdin);p=strchr(str,'\n');if(p)*p='\0';}while(0) static char *getinput( char* str ); static char *getinput(char* str) {char c;char *cp;cp=&str[0];c=fgetc(stdin);while( c != EOF ){if((c==' ')||( c=='\n')) break;*cp++=c;c=fgetc(stdin);}*cp='\0';return &str[0];} #define REP(a,b) for(int a=0;a<(int)(b);++a) #define INPBUF (4+3) int item[100]; // *********************** int main(void) { char str[INPBUF]; int query; int val; int ans; int nokori; // init REP(i,100) item[i] = 0; // ready INPUT(str); sscanf( str , "%d", &query ); REP(i,query*3) { getinput(str); sscanf( str , "%d", &val ); item[val-1]++; } // start ans = 0; nokori = 0; REP(i,100) { ans += item[i]/2; nokori += ( item[i] & 1 ); } ans += nokori / 4; printf("%d\n", ans ); return 0; }