N = int(input()) items = [0] * 10 cnt = 0 for i in range(N): for v in input().split(): idx = int(v)-1 if items[idx] == 1: cnt += 1 items[idx] &= 0 else: items[idx] |= 1 cnt += items.count(1)//4 print(cnt)