def main(): N = int(input()) X = tuple(map(int, input().split())) if N & 1: print(1) else: print(0) main()