N = int(input()) x_pos = list(map(int, input().split())) odd_x = [x for x in x_pos if x % 2 != 0] print(abs(len(x_pos) - 2 * len(odd_x)))