N = int(input()) X = list(map(lambda x: int(x) % 2, input().split())) z = X.count(0) o = X.count(1) print(z % 2 ^ o % 2)