#include #include #include #include #include #include #include #include #include using namespace std; #define INIT cin.tie(0); ios::sync_with_stdio(false); #define FOR(i, a, n) for (int i = a; i < n; i++) #define REP(i, n) for(int i = 0; i < n; i++) int main() { INIT; int n; cin >> n; int A[10] = {}; REP(i, n){ int a, b, c; cin >> a >> b >> c; A[a - 1]++; A[b - 1]++; A[c - 1]++; } int cnt = 0; int c = 0; REP(i, 10){ if(A[i] >= 2) cnt += A[i] / 2; if(A[i] == 1) c++; if(c == 4){ cnt++; c = 0; } } cout << cnt << endl; return 0; }