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.*;
import java.util.*;
import java.math.*;
 
public class main {
    public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    public static PrintWriter pw = new PrintWriter(System.out);
    public static String line;
    public static StringTokenizer st, st2;
    public static ArrayList<ArrayList<Integer>> adjList;
    public static int[] dx = {-1, 0, 1, 0, -1, 1, 1, -1, 0};
    public static int[] dy = {0, 1, 0, -1, 1, 1, -1, -1, 0};
    public static int INF = 0x3f3f3f3f;
    public static int MOD = 1000000007;
    public static long LINF = 0x3f3f3f3f3f3f3f3fL;

    public static void main(String[] args) throws Exception {
        int n = Integer.parseInt(br.readLine());

        HashMap<Integer, Integer> d = new HashMap<Integer, Integer>();
        d.put(0, 4);
        d.put(1, 1);
        d.put(2, 3);
        d.put(3, 2);
        d.put(4, 0);
        d.put(5, 5);

        int ans = 0;

        for (int i = 0; i < 6; i++) {
            int o = d.get(i);
            if ((n & (1 << i)) != 0) {
                ans |= (1 << o);
            }
        }

        System.out.println(ans);


        pw.close();
        br.close();
    }
}

class Pair implements Comparable<Pair>{
    public int a, b;

    Pair(int _a, int _b){
        a = _a;
        b = _b;
    }
 
    public String toString(){
        return a + " " + b;
    }

    public int compareTo(Pair p){
        if (a != p.a) return a < p.a ? -1 : 1;
        if (b != p.b) return b < p.b ? -1 : 1;
        return 0;
    }
}