#coding:utf-8 N=input() X=map(int,raw_input().split()) if N%2==0: print 0 else: print 1