#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) template inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); } template inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); } typedef long long ll; int const inf = 1<<29; int main() { int N; cin >> N; map items; rep(i, N) { int x, y, z; cin >> x >> y >> z; items[x]++, items[y]++, items[z]++; } int ans = 0; for(auto& e: items) { ans += e.second / 2; e.second %= 2; } int rem = 0; for(auto& e: items) { rem += e.second; } ans += rem / 4; cout << ans << endl; return 0; }