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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Test {

    static int counter = 0;

    public static void main(String[] args) {

        Reader input = new Reader();
        PrintWriter out = new PrintWriter(System.out);
        
        int a = input.nextInt();    
        int[] bits = new int[6];

        for (int i = 5; i >= 0; i--) {
            bits[i] = a % 2;
            a /= 2;
        }

        int temp = bits[1];
        bits[1] = bits[5];
        bits[5] = temp;
        temp = bits[2];
        bits[2] = bits[3];
        bits[3] = temp;

        StringBuilder result = new StringBuilder();
        for (int x : bits) {
            result.append(x);
        }
        out.println(Integer.parseInt(result.toString(), 2));
        out.close();
    } 

    static class Reader {
        
        BufferedReader br;
        StringTokenizer st;

        public Reader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {

            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException ex) {
                    ex.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine() {

            String str = "";
            try {
                str = br.readLine();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return str;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}