N = int(input()) x = 2 y = pow(x,128) print(y % N)