i=input i() Z=[int(x)%2 for x in i().split()].count print(abs(Z(0)-Z(1)))