#include <bits/stdc++.h>
using namespace std;
const long long N = 1000;
const long long mod = 1e9 + 7;
const long long INF = 0x3f3f3f3f;
long long p[N], cnt;
bool vis[N];
void getprime(long long n) {
  memset(vis, false, sizeof(vis));
  for (long long i = 2; i <= n; i++) {
    if (!vis[i]) p[++cnt] = i;
    for (long long j = 1; j <= cnt && p[j] <= n / i; j++) {
      vis[p[j] * i] = true;
      if (i % p[j] == 0) break;
    }
  }
}
long long a[45] = {0,       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};
long long qpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  cout << qpow(2, a[n] - 1) - 1 << endl;
  return 0;
}
