N = input() X = map(int, raw_input().split()) print 1 if len(X) % 2 == 1 else 0