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