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.io.PrintStream;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
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;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
//        int[] p = {4, 1, 3, 0, 2, 5};
            int[] p = {4, 1, 3, 2, 0, 5};
            if (false) {
                rec(0, 6, new int[6], new boolean[6]);
            }

            int x = in.nextInt();
            int z = 0;
            for (int i = 0; i < 6; i++) {
                z |= ((x >> i) & 1) << p[i];
            }
            out.println(z);
        }

        private void rec(int pos, int n, int[] p, boolean[] u) {
            if (pos == n) {
                boolean ok = true;
                for (int[] a : new int[][]{{2, 2}, {5, 24}, {35, 50}}) {
                    int x = a[0];
                    int y = a[1];
                    int z = 0;
                    for (int i = 0; i < 6; i++) {
                        z |= ((x >> i) & 1) << p[i];
                    }
                    if (y != z) {
                        ok = false;
                    }
                }
                if (ok) {
                    System.out.println(Arrays.toString(p));
                    String[] s = "and they lived happily ever after".split(" ");
//                String[] s = "and after happily lived ever they".split(" ");
                    for (int i = 0; i < 6; i++) {
                        System.out.println(s[p[i]]);
                    }
                    System.out.println();
                }
                return;
            }
            for (int i = 0; i < n; i++) {
                if (u[i]) {
                    continue;
                }
                p[pos] = i;
                u[i] ^= true;
                rec(pos + 1, n, p, u);
                u[i] ^= true;
            }
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

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

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

    }
}