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.Scanner;

public class __Andafterhappilylivedeverthey {
    public static String addZeros(String bin){
        if(bin.length() == 1){
            bin = "00000" + bin;
        }
        else if(bin.length() == 2){
            bin = "0000" + bin;
        }
        else if(bin.length() == 3){
            bin = "000" + bin;
        }
        else if(bin.length() == 4){
            bin = "00" + bin;
        }
        else{
            bin = "0" + bin;
        }
        return bin;
    }

    public static void swap(char[] arr, int i, int f){
        char temp = arr[i];
        arr[i] = arr[f];
        arr[f] = temp;
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        String bin = Integer.toBinaryString(a);
        if(bin.length() < 6){
            bin =  addZeros(bin);
        }
        char[] arr = bin.toCharArray();
        swap(arr, 1, 5); // we are suppose to exchange the 2nd and 6th position but as the index of the array starts from 0 so we'll exchange the 1st and the 5th index
        swap(arr, 2, 3); // Similarly we take the 3rd and 4th positions as 2nd and 3rd according to the array index
        String binary = new String(arr);
        if(binary == "000000")
        {
            System.out.println("0");
        }
        else{
            System.out.println(Integer.parseInt(binary, 2));
        }
    }
}