x=2**128 print(x % int(input()))