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