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.*;
import java.io.*;

public class Problem1 {
	static int memo[][];
	static int n;
	static int[] a;
	final static int Infinity = Integer.MAX_VALUE;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int a = sc.nextInt();
		int[] arr = new int[6];
		n = a;
		for (int i = 0; i < 6; i++) {
			arr[5-i] = 1 & (n >> i);
		}
		int[] ans = new int[6];
		ans[0] = arr[0];
		ans[1] = arr[5];
		ans[2] = arr[3];
		ans[3] = arr[2];
		ans[4] = arr[4];
		ans[5] = arr[1];
		int s = 0;
		for (int i = 5; i >= 0 ; i--)
			if(ans[i]==1)
				s += (int) Math.pow(2, 5-i);
		
		System.out.println(s);
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

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

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

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}