#if defined(__GNUG__) && !defined(__clang__) #include #endif #define inf(T) (numeric_limits::min()) #define sup(T) (numeric_limits::max()) #define rep(i,n) for (int i = 0; i < (n); i++) #define asc(c) (c).begin(), (c).end() #define desc(c) (c).rbegin(), (c).rend() #define mp(...) make_pair(__VA_ARGS__) #define mt(...) make_tuple(__VA_ARGS__) using namespace std; using ll = long long; using ld = long double; template using uset = unordered_set; template using umap = unordered_map; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector items(10); while (n--) { int a, b, c; cin >> a >> b >> c; items[a - 1] += 1; items[b - 1] += 1; items[c - 1] += 1; } int n_up = 0; rep(i,10) { n_up += items[i] / 2; items[i] %= 2; } n_up += accumulate(asc(items), 0) / 4; cout << n_up << endl; return 0; }