n=int(input()) a=len([1 for _ in list(map(int,input().split())) if _ % 2 == 0]) print(abs(a-(n-a)))