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 MysteryCircuit {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int z = sc.nextInt();
		if (z == 0)
			System.out.println("15");
		else {
			String binaryString1 = Integer.toBinaryString(z);
			StringBuilder binaryStringBuilder1 = new StringBuilder(
					getZeroString(4 - binaryString1.length()) + binaryString1);
			binaryStringBuilder1 = binaryStringBuilder1.reverse();
			int t = Integer.parseInt(binaryStringBuilder1.toString(), 2);
			t--;
			String binaryString2 = Integer.toBinaryString(t);
			StringBuilder binaryStringBuilder2 = new StringBuilder(
					getZeroString(4 - binaryString2.length()) + binaryString2);
			binaryStringBuilder2 = binaryStringBuilder2.reverse();
			System.out.println(Integer.parseInt(binaryStringBuilder2.toString(), 2));
		}
		sc.close();
	}

	private static String getZeroString(int n) {
		String output = "";
		for (int i = 0; i < n; i++)
			output += "0";
		return output;
	}
}