n=int(input()) a=[] for i in range(n): b,c,d=map(int,input().split()) a.append(b) a.append(c) a.append(d) from collections import Counter c=Counter(a) amr=0 pw=0 for i in c.values(): pw+=i//2 amr+=i%2 print(pw+amr//4)