N = int(input()) X = sorted(list(map(int, input().split()))) stack = [] for x in X: if stack: if (x + stack[-1]) % 2: stack.pop() else: stack.append(x) else: stack.append(x) print(len(stack))