from collections import Counter n = int(input()) S = [] for _ in range(n): a,b,c = map(int,input().split()) S.append(a) S.append(b) S.append(c) ctr = Counter(S) ret = 0 tank = 0 for k,v in ctr.items(): if v>=2: ret += v//2 tank += v%2 print(ret + tank//4)