N, *X = map(int, open(0).read().split()) print(abs(2 * len([0 for x in X if x % 2 == 1]) - N))