#include #include #include #include #include using namespace std; typedef long long int lont; int main() { int N; cin >> N; int M = N * 3; int cnta = 1; int suma = 0; vectorveca(M+1); for (int ia = 0; ia < M; ia++) { cin >> veca.at(ia); } sort(veca.begin(), veca.end()); reverse(veca.begin(), veca.end()); for (int ib = 0; ib < M; ib++) { if (veca.at(ib) == veca.at(ib + 1)) { cnta++; } else { suma += cnta / 2; cnta = 1; } } cout << suma + (M - suma * 2) / 4 << endl; }