#初始状态关 #开(1),关(2),开(3),关(4),开(5),关(6).....开(奇数),关(偶数) m=int(input()) if m%2==0: #n为偶数次,此时是关的状态——————输出0 print(0) else: print(1)