#define _GLIBCXX_DEBUG #define ll long long #include using namespace std; using Graph = vector>; void print(auto a){ cout << a; } void printL(auto a){ cout << a << endl; } void fix(int n){ cout << fixed << setprecision(n); } ll RD(ll n, ll m){ return n/m; } void INP(int n, vector &A){ for(int i = 0; i < 3; i++){ int a; cin >> a; A[a-1]++; } if(n > 1) INP(n-1, A); } void ANS(vector A){ int ans = 0, mod = 0; for(int i = 0; i < (int)A.size(); i++){ ans += A[i]/2; mod += A[i]%2; } ans += mod/4; printL(ans); } int main(){ int N; cin >> N; vector A(10, 0); INP(N, A); ANS(A); }