#include #include using namespace std; int main() { int N, Item[10]; cin >> N; for (int i = 0; i < 10; i++) Item[i] = 0; for (int i = 0; i < N; i++) { int a, b, c; cin >> a >> b >> c; Item[a] += 1; Item[b] += 1; Item[c] += 1; } int q = 0, r = 0, ans = 0; for (int i = 0; i < 10; i++) { q += (Item[i] / 2); r += (Item[i] % 2); } ans += q + (r / 4); cout << ans << endl; return 0; }