#include #include using namespace std; int main(int argc, char* argv[]) { int n; cin >> n; vector itemCount(10); for (int i = 0; i < n; ++i) { for (int j = 0; j < 3; ++j) { int item; cin >> item; ++itemCount[item - 1]; } } int powerUpCount = 0; int anyItemCount = 0; for (int i = 0; i < 10; ++i) { while (itemCount[i] >= 2) { ++powerUpCount; itemCount[i] -= 2; } anyItemCount += itemCount[i]; } powerUpCount += anyItemCount / 4; cout << powerUpCount << endl; return 0; }