#include #include #include #define REP(i, a) for(int i = 0; i < a; i++) using namespace std; /* 同じアイテム2つか任意のアイテム4つでパワーアップ */ int main () { int N; vector items(10, 0); // 0~9の10種類のアイテム cin >> N; REP(i, N) { REP(j, 3) { int get_item; cin >> get_item; items[get_item-1]++; } } int power_up = 0, cnt = 0; REP(i, items.size()) { if (items[i] > 1) { power_up += items[i] / 2; cnt += items[i] % 2; } else cnt += items[i]; } power_up += cnt / 4; cout << power_up << endl; return 0; }