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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CAndAfterHappilyLivedEverThey solver = new CAndAfterHappilyLivedEverThey();
        solver.solve(1, in, out);
        out.close();
    }

    static class CAndAfterHappilyLivedEverThey {
        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            int n = sc.nextInt();
            char[] arr = new char[31];
            Arrays.fill(arr, '0');
            char[] temp = Integer.toBinaryString(n).toCharArray();
            int j = temp.length - 1;
            int i = arr.length - 1;
            while (j >= 0) {
                arr[i--] = temp[j--];
            }
            char temp2 = arr[30 - 4];
            arr[30 - 4] = arr[30];
            arr[30] = temp2;
            temp2 = arr[28];
            arr[28] = arr[27];
            arr[27] = temp2;
            pw.println(Integer.parseInt(new String(arr), 2));
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

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

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

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

    }
}