n=int(input()) item=[0]*10 ans=0 for i in range(n): a,b,c=map(int,input().split()) item[a-1]+=1 item[b-1]+=1 item[c-1]+=1 for x in range(10): if item[x]>=2: ans+=(item[x]//2) item[x]=item[x]%2 ans+=(sum(x==1 for x in item)//4) print(ans)