import sys N = int(input()) X = list(map(int, sys.stdin.read().split())) oc = sum(1 for x in X if x % 2 == 1) ec = sum(1 for x in X if x % 2 == 0) print(abs(oc - ec))