n = int(input()) coordinates = [int(x) for x in input().split(' ')] even = [x for x in coordinates if x % 2 == 0] odd = [x for x in coordinates if x % 2 != 0] print(abs(len(even) - len(odd)))