# No.99 ジャンピング駒 n = int(input()) x = [int(i) for i in input().split()] print(n % 2)