def main(): N = int(input()) dic = set() cnt = 0 for i in range(N): abc = list(map(int, input().split())) for v in abc: if v in dic: cnt += 1 dic.remove(v) else: dic.add(v) cnt += len(dic) // 4 print(cnt) main()