print(abs(int(input())-sum(int(x)%2 for x in input().split())*2))