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