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>
int main() {
  int n;
  scanf("%d", &n);
  switch (n) {
    case 1:
      printf("4");
      break;
    case 2:
      printf("22");
      break;
    case 3:
      printf("27");
      break;
    case 4:
      printf("58");
      break;
    case 5:
      printf("85");
      break;
    case 6:
      printf("94");
      break;
    case 7:
      printf("121");
      break;
    case 8:
      printf("166");
      break;
    case 9:
      printf("202");
      break;
    case 10:
      printf("265");
      break;
    case 11:
      printf("274");
      break;
    case 12:
      printf("319");
      break;
    case 13:
      printf("346");
      break;
    case 14:
      printf("355");
      break;
    case 15:
      printf("378");
      break;
    case 16:
      printf("382");
      break;
    case 17:
      printf("391");
      break;
    case 18:
      printf("438");
      break;
    case 19:
      printf("454");
      break;
    case 20:
      printf("483");
      break;
    case 21:
      printf("517");
      break;
    case 22:
      printf("526");
      break;
    case 23:
      printf("535");
      break;
    case 24:
      printf("562");
      break;
    case 25:
      printf("576");
      break;
    case 26:
      printf("588");
      break;
    case 27:
      printf("627");
      break;
    case 28:
      printf("634");
      break;
    case 29:
      printf("636");
      break;
    case 30:
      printf("645");
      break;
  }
}