N = input() AA = [] for i in range(0,N): AA.extend(list(map(int,raw_input().split()))) cnt,nokori = 0,0 for i in range(1,N+1): if AA.count(i)%2 == 0: cnt += AA.count(i)/2 nokori += 0 else: cnt += AA.count(i)/2 nokori += 1 print cnt+(len(AA)-2*cnt)/4