#include using namespace std; int main(){ int n; cin >> n; vector items(10,0); while(n--){ for(int i=0;i<3;i++){ int a; cin >> a; items[a-1]++; } } int power_up=0; int residue=0; for(int i=0;i<10;i++){ power_up+=items[i]/2; residue+=items[i]%2; } power_up+=residue/4; cout << power_up << endl; return 0; }