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