Problem: 

Input

The input contains a single integer a (0 ≤ a ≤ 35).

Output

Output a single integer.

Examples

Input

3


Output

8


Input

10


Output

1024

Solution (in JAVA):

Solution:
import java.math.BigInteger;
import java.util.Scanner;

public class CarmichaelNumbers {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while (in.hasNext()) {
			int x = in.nextInt();
			if (x==1){
				System.out.println("Washington");
			}else if(x==2){
				System.out.println("Adams");
			}
			else if(x==3){
				System.out.println("Jefferson");
			}
			else if(x==4){
				System.out.println("Madison");
			}
			else if(x==5){
				System.out.println("Monroe");
			}
			else if(x==6){
				System.out.println("Adams");
			}
			else if(x==7){
				System.out.println("Jackson");
			}
			
			else if(x==8){
				System.out.println("Van Buren");
			}
			else if(x==9){
				System.out.println("Harrison");
			}else if(x==10){
				System.out.println("Tyler");
			}else if(x==11){
				System.out.println("Polk");
			}else if(x==12){
				System.out.println("Taylor");
			}else if(x==13){
				System.out.println("Fillmore");
			}else if(x==14){
				System.out.println("Pierce");
			}else if(x==15){
				System.out.println("Buchanan");
			}else if(x==16){
				System.out.println("Lincoln");
			}
			else if(x==17){
				System.out.println("Johnson");
			}else if(x==18){
				System.out.println("Grant");
			}else if(x==19){
				System.out.println("Hayes");
			}else if(x==20){
				System.out.println("Garfield");
			}else if(x==21){
				System.out.println("Arthur");
			}else if(x==22){
				System.out.println("Cleveland");
			}else if(x==23){
				System.out.println("Harrison");
			}
			else if(x==24){
				System.out.println("Cleveland");
			}else if(x==25){
				System.out.println("McKinley");
			}else if(x==26){
				System.out.println("Roosevelt");
			}
			else if(x==27){
				System.out.println("Taft");
			}else if(x==28){
				System.out.println("Wilson");
			}
			else if(x==29){
				System.out.println("Harding");
			}
			else if(x==30){
				System.out.println("Coolidge");
			}else if(x==31){
				System.out.println("Hoover");
			}else if(x==32){
				System.out.println("Roosevelt");
			}else if(x==33){
				System.out.println("Truman");
			}else if(x==34){
				System.out.println("Eisenhower");
			}else if(x==35){
				System.out.println("Kennedy");
			}else if(x==36){
				System.out.println("Johnson");
			}else if(x==37){
				System.out.println("Nixon");
			}
			else if(x==38){
				System.out.println("Ford");
			}else if(x==39){
				System.out.println("Carter");
			}else if(x==40){
				System.out.println("Reagan");
			}
			
		}
	}

}