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.*;
import java.util.*;
import static java.lang.System.out;

public class Codechef {

    Scanner in;

    int countSubarrayWithEqualZero(int a[], int n) {
        HashMap<Integer, Integer> mp = new HashMap<>();
        int count = 0;
        int sum = 0;
        // mp.put(0, 1);
        for(int i = 0; i < n; ++i) {
            sum += (a[i] == 0) ? -1 : a[i];
            // out.print(sum);
            mp.put(sum, mp.getOrDefault(sum, 0) + 1);
        }
        Set set = mp.entrySet();
        Iterator itr = set.iterator();
        while(itr.hasNext()) {
            Map.Entry e = (Map.Entry) itr.next();
            // out.print(e.getKey() + " ");
            // out.println(e.getValue());
            if((int)e.getValue() > 1) {
                count += ((int)e.getValue() * ((int)e.getValue() - 1)) / 2;
            }
        }
        if(mp.containsKey(0)) {
            count += mp.get(0);
        }
        return count;
    }

    void solve() {
        // int n = ni();
        // int a[] = na(n);
        // out.println(countSubarrayWithEqualZero(a, n));
        int n = ni();
        int a[] = {1, 6, 4, 3, 5, 2};
        int ans = 0;
        int val = 32;
        for(int i = 0; i < 6; ++i) {
            ans += val * (((n & (1 << (6 - a[i]))) == 0) ? 0 : 1);
            val /= 2;
        }
        out.println(ans);
    }   

    public static void main(String[] args) {
        new Codechef().run();
    }

    // ---------- I/O Template ----------
    void run() {
        in = new Scanner(System.in);
        solve();
    }
    int ni() { return in.nextInt(); }
    long nl() { return in.nextLong(); }
    String nLine() { return in.nextLine(); }
    String ns() { return in.next(); }
    char nc() { return in.next().charAt(0); }
    float nf() { return in.nextFloat(); }
    double nd() { return in.nextDouble(); }
    int[] na(int n) {
        int a[] = new int[n]; 
        for(int i = 0; i < n; i++) { a[i] = ni(); } 
        return a;
    }
    

}