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