N=int(raw_input()) M=[] for loop in xrange(N): A=map(int,raw_input().split()) M+=A num1=0 num2=0 num3=0 num4=0 num5=0 num6=0 num7=0 num8=0 num9=0 num10=0 for i in xrange(3*N): if M[i]==1: num1+=1 elif M[i]==2: num2+=1 elif M[i]==3: num3+=1 elif M[i]==4: num4+=1 elif M[i]==5: num5+=1 elif M[i]==6: num6+=1 elif M[i]==7: num7+=1 elif M[i]==8: num8+=1 elif M[i]==9: num9+=1 elif M[i]==10: num10+=1 Ans=num1/2+num2/2+num3/2+num4/2+num5/2+num6/2+num7/2+num8/2+num9/2+num10/2+(num1%2+num2%2+num3%2+num4%2+num5%2+num6%2+num7%2+num8%2+num9%2+num10%2)/4 print Ans