#include #include #include int main() { int N; std::cin >> N; std::vector Item; Item.resize(N * 3); for (int i = 0; i < N * 3; i++) { std::cin >> Item[i]; } std::array ItemAll; for (int i = 0; i < 10; i++) { ItemAll[i] = 0; } for (int i = 0, n = (unsigned)Item.size(); i < n; i++) { ItemAll[Item[i]]++; } int PowerUp = 0; for (int i = 0; i < 10; i++) { while (ItemAll[i] >= 2) { PowerUp++; ItemAll[i] -= 2; } } for (int i = 1; i < 10; i++) { ItemAll[0] += ItemAll[i]; } PowerUp += ItemAll[0] / 4; std::cout << PowerUp << std::endl; return 0; }