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