#include int main(void){ int n; int count[10] = {0}; int power = 0; int flag = 0; scanf("%d",&n); int temp; for(int i = 0;i < n;i++){ for(int j = 0;j < 3;j++){ scanf("%d",&temp); count[temp-1]++; } } for(;;){ for(int i = 0;i < 10;i++){ if(count[i] >= 2){ power++; count[i] -= 2; flag++; } } if(flag == 0) break; flag = 0; } for(;;){ for(int i = 0;i < 10;i++){ if(count[i] >= 1){ if(flag == 4) break; flag++; count[i]--; } } if(flag == 4) power++; if(flag == 0) break; flag = 0; } printf("%d\n",power); return 0; }