n = int(input()) A = list(map(int, input().split())) print(abs(len([a for a in A if a % 2 == 0]) - len([a for a in A if a % 2 == 1])))