import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long m = Long.parseLong(br.readLine()); br.close(); long ans = 1; for (int i = 0; i < 128; i++) { ans *= 2; ans %= m; } System.out.println(ans); } }