m = int(input()) x = 1 for i in range(128): x *= 2 x %= m print(x)