M=11;A=[0]*M;N=input() while N:N-=1;a,b,c=map(int,raw_input().split());A[a]+=1;A[b]+=1;A[c]+=1 while M:M-=1;N+=A[M]/2;A[M]%=2 print N+sum(A)/4