N=int(raw_input()) L=[0 for a in range(10)] ct=0 for n in range(N): a, b, c=map(int, raw_input().split()) L[a-1]+=1 L[b-1]+=1 L[c-1]+=1 for m in range(10): if L[m]>=2: ct+=L[m]/2 L[m]%=2 S=sum(L) ct+=S/4 print ct