#include #include #include #include #include #include #include #include #include #include #include #include #define FOR(i, a, b) for(int i=(a);i<=(b);i++) #define RFOR(i, a, b) for(int i=(a);i>=(b);i--) #define MOD 1000000007 #define INF 1000000000 using namespace std; int main(void) { int n; int dp[11] = {}; int count = 0; int total = 0; cin >> n; FOR(i, 1, n) { int a, b, c; cin >> a >> b >> c; dp[a]++; dp[b]++; dp[c]++; } FOR(i, 1, n) { while (dp[i] >= 2) { count++; dp[i] -= 2; } } FOR(i, 1, n) { total += dp[i]; } count += total / 4; cout << count << endl; return 0; }