#!/usr/bin/python3
# †
M = int(input())
assert 1 <= M < 2**60
res = 2**128 % M
print(res)