N=int(input()) a=[[int(i) for i in input().split()] for i in range(N)] ite=[0]*11 for i in range(N): for j in range(3): # print(ite[a[i][j]]) ite[a[i][j]]+=1 p=0 r=0 for i in range(10): p+=ite[i]//2 r+=ite[i]%2 r//=4 p+=r print(p)