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:


/*
 * You are probably familiar with the fairy tale ending "... and they lived happily ever after". 
 * The problem title is almost that phrase, but with the words scrambled. 
 * If you check the problem statement in the other language, 
 * it will be a different 6-word phrase that underwent the same scramble. 
 * The constraints on the input say that it is an integer are from 0 to 2^6-1; 
 * these two things together should push you towards thinking about binary. 
 * The solution is as follows: read the input, convert it into a 6-bit binary 
 * representation and scramble it in the same way as the words in the title are 
 * scrambled (swapping the 2nd with the 6th and the 3rd with the 4th) before converting it back to the integer. 
 * You didn't need to worry whether you need to apply the permutation or the inverse permutation, 
 * since those two were the same
 */

import java.io.*;
import java.util.Arrays;

public class AndAfterHappilyLivedeEverThey {

	int arr[] = new int[6];

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		int arr[] = new int[6];

		decimalToBinary(n, arr);

		// swap 0th and 4th index(6th and 2nd from right)
		int temp = arr[5];
		arr[5] = arr[1];
		arr[1] = temp;

		// swap 2nd and 3rd index(3rd and 4th from right)
		temp = arr[2];
		arr[2] = arr[3];
		arr[3] = temp;

		System.out.println(binaryToDecimal(arr));
		// System.out.println(Arrays.toString(arr));
	}

	public static void decimalToBinary(int n, int arr[]) {

		int i = 5;
		while (i >= 0) {
			arr[i--] = n % 2;
			n /= 2;
		}
		// System.out.println(Arrays.toString(arr));
	}

	public static int binaryToDecimal(int[] arr) {

		int num = 0;
		for (int i = 5; i >= 0; i--) {
			if (arr[i] != 0)
				num += (Math.pow(2, 5 - i));
		}
		return num;
	}

}