print(abs(int(input())-2*len([x for x in input().split() if int(x)%2])))