n = int(input()) print(0) if n % 2 == 0 else print(1)