n = int(raw_input()) x = map(int,raw_input().split()) if n%2 == 0: print 1 else: print 0