#include #include #include #include #include #include #include #include #include #include #include using namespace std; namespace Estd { // return 1's position (...3210) by given bs; // invarient: bs.count() == 1; // ex: 0000100 -> 2 template constexpr size_t position(const bitset bs) { assert(bs.count() == 1); for (int i = 0; i < N; ++i) { if (bs[i] == 1) return i; } throw; } }; void solve() { int N {}; cin >> N; int cnt {0}; bitset<10+1> bs {}; for (int i = 0; i < 3*N; ++i) { int item {}; cin >> item; if (bs[item]) { ++cnt; bs.reset(item); } else { bs.set(item); } } cnt += bs.count() / 4; cout << cnt << endl; } int main() { solve(); return 0; }