input() n = [0,0] for x in map(int,raw_input().split()): n[x%2] += 1 print abs(n[0]-n[1])