n = int(input()) x = list(map(int, input().split())) x = sorted(x) odd = 0 even = 0 count = 0 print(len(x)) for i in range(n): if abs(i) % 2 == 0: even += 1 else: odd += 1 if odd <= even: count = odd * 2 else: count = even * 2 print(n - count)