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