from collections import Counter N = int(input()) counter = Counter(map(int, input().split())) size = list(counter.keys()) print(max(sum(counter[v] for v in size[::2]), sum(counter[v] for v in size[1::2])))