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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
void mad(long long int &a, long long int b) {
  a = (a + b) % 1000000007;
  if (a < 0) a += 1000000007;
}
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
vector<long long int> printDivisors(int n) {
  vector<long long int> v;
  for (int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i) {
        v.push_back(i);
      } else {
        v.push_back(n / i);
        v.push_back(i);
      }
    }
  }
  return v;
}
bool check(long long int i, long long int j, long long int n, long long int m) {
  if (i < 0 || j < 0 || i > n - 1 || j > m - 1) {
    return false;
  }
  return true;
}
bool prime[1000003];
void SieveOfEratosthenes(int n) {
  memset(prime, true, sizeof(prime));
  map<long long int, long long int> mp;
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  prime[1] = false;
  prime[0] = false;
}
long long int dp[2000003] = {0};
long long int arr[2000010], b[2000010];
struct Tree {
  long long int ssum;
  long long int tsum;
};
struct Lazy {
  long long int set;
  long long int update;
};
Tree tree[2000010];
Lazy lazy[2000010];
long long int n;
map<long long int, long long int> primeFactors(long long int n) {
  map<long long int, long long int> mp;
  while (n % 2 == 0) {
    mp[2]++;
    n = n / 2;
  }
  for (long long int i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      mp[i]++;
      n = n / i;
    }
  }
  if (n > 2) {
    mp[n]++;
  }
  return mp;
}
map<char, long long int> mA;
long long int pali(string s) {
  long long int i = 0;
  long long int j = s.length() - 1;
  long long int count = 0;
  while (i < j) {
    mA[s[j]]++;
    if (s[i] == s[j])
      ;
    else {
      mA[s[i]]++;
      count++;
    }
    i++;
    j--;
  }
  return count;
}
string pali2(string s) {
  long long int i = 0;
  long long int j = s.length() - 1;
  long long int count = 0;
  while (i < j) {
    if (s[i] == s[j])
      ;
    else {
      if (mA[s[i]] > mA[s[j]]) {
        s[j] = s[i];
      } else {
        s[i] = s[j];
      }
    }
    i++;
    j--;
  }
  return s;
}
long long int check(string s, string res) {
  long long int count = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == res[i]) continue;
    count++;
  }
  return count;
}
void made(string s, map<char, long long int> &mp) {
  mp[s[0]]++;
  mp[s.length() - 1]++;
}
set<long long int> edges[2000010];
long long int visited[2000010];
void dfs(long long int s, vector<long long int> &ch) {
  visited[s] = true;
  ch.push_back(s);
  for (auto it : edges[s]) {
    if (!visited[it]) {
      dfs(it, ch);
    }
  }
}
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> v;
  long long int arr[8] = {0};
  long long int k = 6;
  while (n != 0) {
    if (n % 2) {
      arr[k] = 1;
    } else {
      arr[k] = 0;
    }
    n = n / 2;
    k--;
  }
  swap(arr[2], arr[6]);
  swap(arr[3], arr[4]);
  for (int i = 6; i >= 1; i--) {
    n = n + arr[i] * pow(2, 6 - i);
  }
  cout << n << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  for (int i = 0; i < t; i++) {
    solve();
  }
  return 0;
}