import java.util.Scanner; public class Main { public static void main(String[] args) { new Main(); } public Main() { try (Scanner sc = new Scanner(System.in)) { long M = sc.nextLong(); long ans = 1; for (int i = 0;i < 128;++ i) ans = ans * 2 % M; System.out.println(ans); } } }