N = int(input()) power_up = 0 items = {} for i in range(N): for j in input().split(): items.setdefault(j,0) t = items[j] + 1 if not t % 2: t = 0 power_up+=1 items[j] = t power_up+=sum(items.values()) // 4 print(power_up)