#include using namespace std; int main() { int N; cin >> N; vector a(N), b(N), c(N); for (int i = 0; i < N; i++) cin >> a[i] >> b[i] >> c[i]; int item[11] = {}; for (int i = 0; i < N; i++) item[a[i]]++, item[b[i]]++, item[c[i]]++; int ans = 0, kind = 0; for (int i = 1; i <= 10; i++) ans += item[i] / 2, item[i] -= item[i] / 2 * 2; for (int i = 1; i <= 10; i++) if (item[i] == 1) kind++; ans += kind / 4; cout << ans << endl; }