#include #include #include #include using namespace std; int main(){ int n; cin>> n; vector vec(10); int a, b, c; for(int i=0; i> a>> b>> c; vec[a-1]++; vec[b-1]++; vec[c-1]++; } int ans = 0, amari = 0; for(int i=0; i<10; i++){ ans += vec[i]/2; amari += vec[i]%2; } amari = amari/4; cout<< ans+amari<< endl; return 0; }