def main(): N = int(input()) X = tuple(map(int, input().split())) even = [i for i in X if not i & 1] odd = [i for i in X if i & 1] print(abs(len(even) - len(odd))) main()