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 gcd(long long int a, long long int b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a == b) return a;
  if (a > b) return gcd(a - b, b);
  return gcd(a, b - a);
}
int largest(long long int arr[], long long int n) {
  return *max_element(arr, arr + n);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
long long int power(long long int x, unsigned long long int y) {
  long long int temp;
  if (y == 0) return 1;
  temp = power(x, y / 2);
  if (y % 2 == 0)
    return temp * temp;
  else {
    if (y > 0)
      return x * temp * temp;
    else
      return (temp * temp) / x;
  }
}
bool comp(int a, int b) { return (a < b); }
void divisors(long long 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(i);
      v.push_back(n / i);
    }
  }
}
bool prime(long long int n) {
  if (n <= 1) return false;
  for (long long int i = 2; i < n; i++)
    if (n % i == 0) return false;
  return true;
}
void factors(long long int n) {
  vector<long long int> v;
  while (n % 2 == 0) {
    cout << 2 << " ";
    n = n / 2;
  }
  for (long long int i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      v.push_back(i);
      n = n / i;
    }
  }
  if (n > 2) v.push_back(n);
}
bool powertwo(long long int x) { return x && (!(x & (x - 1))); }
bool ans(long long int arr[], long long int i, long long int r) {
  if (i > 4) {
    return false;
  }
  if (r == 0 && i <= 4) {
    return true;
  } else {
    return ans(arr, i + 1, r - arr[i]) || ans(arr, i + 1, r);
  }
}
void solve() {
  long long int x;
  cin >> x;
  if (x == 3) {
    printf("13\n");
  } else if (x == 0) {
    printf("15\n");
  } else if (x == 1) {
    printf("14\n");
  } else if (x == 2) {
    printf("12\n");
  } else if (x == 4) {
    printf("8\n");
  } else if (x == 5) {
    printf("9\n");
  } else if (x == 6) {
    printf("10\n");
  } else if (x == 7) {
    printf("11\n");
  } else if (x == 8) {
    printf("0\n");
  } else if (x == 9) {
    printf("1\n");
  } else if (x == 10) {
    printf("2\n");
  } else if (x == 11) {
    printf("3\n");
  } else if (x == 12) {
    printf("4\n");
  } else if (x == 13) {
    printf("5\n");
  } else
    cout << x - 8 << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  solve();
}