#include #define rep(i, n) for(long long i = 0; i < n; i++) #define ALL(v) (v).begin(), (v).end() using namespace std; using lint = long long; int main() { int n; cin >> n; vector cnt(10); rep(i, n) { int a, b, c; cin >> a >> b >> c; a--; b--; c--; cnt[a]++; cnt[b]++; cnt[c]++; } int ans = 0; rep(i, 10) { ans += cnt[i] / 2; cnt[i] %= 2; } ans += accumulate(ALL(cnt), 0) / 4; cout << ans << endl; }