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.util.*;
public class happyafter{
    public static void main(String [] args){
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    String str = Integer.toBinaryString(n);
    int len = str.length();
    String str1;
    if(len>6) str1 = str.substring(len-6, len);
    else if(len<6){
        String temporary="";
        int x =6-len;
        while(x-- >0){
            temporary+="0";
        }
        str1 =temporary+str;
    }
    else{
        str1 =str;
    }
    char [] arr= str1.toCharArray();
    char temp;
    temp =arr[1];
    arr[1]=arr[5];
    arr[5]=temp;
    temp =arr[2];
    arr[2]=arr[3];
    arr[3]=temp;
    String res;
    if(len>6){
    res =str.substring(0,len-6) + String.valueOf(arr);
    }
    else{
        res =String.valueOf(arr);
    }
    int result=Integer.parseInt(res,2); 
    System.out.println(result);
    }
}