#include #define test cout << "test"; using namespace std; int main(void){ int item[9],temp; cin >> temp; const int num = temp; for(int i = 0; i < 9; i++)item[i] = 0; for(int i = 0; i < num; i++){ for(int j = 0; j < 3; j++){ cin >> temp; item[temp - 1]++; } } int count = 0; temp = 0; for(int i = 0; i < 9; i++){ while(item[i] >= 2){ count++; item[i] -= 2; } if(item[i] == 1)temp++; } cout << count + temp / 4 << endl; return 0; }