#include "bits/stdc++.h" using namespace std; int main() { int N, a, b, c, Item[10] = {}, sum = 0, count = 0; cin >> N; for (int i = 0; i < N; i++) { cin >> a >> b >> c; Item[a - 1]++; Item[b - 1]++; Item[c - 1]++; } for (int i = 0; i < 10; i++) { count += Item[i] / 2; Item[i] = Item[i] % 2; sum += Item[i]; } count += sum / 4; cout << count << endl; }