#include <bits/stdc++.h>
using namespace std;
template <class _T>
inline _T sqr(const _T& x) {
  return x * x;
}
template <class _T>
inline string tostr(const _T& a) {
  ostringstream os("");
  os << a;
  return os.str();
}
const long double PI = 3.1415926535897932384626433832795L;
const long double EPS = 1e-11;
char TEMPORARY_CHAR;
const long long INF = 1e17;
inline void input(int& a) {
  a = 0;
  while (((TEMPORARY_CHAR = getchar()) > '9' || TEMPORARY_CHAR < '0') &&
         (TEMPORARY_CHAR != '-')) {
  }
  char neg = 0;
  if (TEMPORARY_CHAR == '-') {
    neg = 1;
    TEMPORARY_CHAR = getchar();
  }
  while (TEMPORARY_CHAR <= '9' && TEMPORARY_CHAR >= '0') {
    a = (a << 3) + (a << 1) + TEMPORARY_CHAR - '0';
    TEMPORARY_CHAR = getchar();
  }
  if (neg) a = -a;
}
inline int nxt() {
  int(ret);
  input((ret));
  ;
  return ret;
}
long long p[] = {2,       3,       5,        7,        13,      17,
                 19,      31,      61,       89,       107,     127,
                 521,     607,     1279,     2203,     2281,    3217,
                 4253,    4423,    9689,     9941,     11213,   19937,
                 21701,   23209,   44497,    86243,    110503,  132049,
                 216091,  756839,  859433,   1257787,  1398269, 2976221,
                 3021377, 6972593, 13466917, 20996011, 24036583};
long long mod = 1000000007;
long long pw(long long a, long long n) {
  if (n == 0) return 1ll;
  long long res = pw(a, n / 2ll);
  res = (res * res) % mod;
  if (n & 1) res = (res * a) % mod;
  return res;
}
int main() {
  int(n);
  input((n));
  ;
  cout << (pw(2ll, p[n - 1] - 1) - 1 + mod) % mod;
  return 0;
}
