N = int(input()) L = list(map(int, input().split())) A = len([a for a in L if a % 2 == 0]) B = N - A print([1, 0][A == B])