function main(input) {
	input = input.split("\n");
	const m = BigInt(input[0]);
	let ans = 1n;
	for(let i=0; i<128; i++) {
	    ans *= 2n;
	    ans %= m;
	}
	console.log(ans.toString());
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));