n = int(input()) x = [int(x) for x in input().split()] even = 0 for xi in x: if xi % 2 == 0: even += 1 res = abs(len(x) - 2 * even) print(res)