#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int n, mod = 1000000007;
long long binpow(long long a, int n) {
  long long r = 1;
  while (n) {
    if (n & 1) r = (r * a) % mod;
    a = (a * a) % mod;
    n >>= 1;
  }
  return r;
}
int p[50];
void solve() {
  p[1] = 2;
  p[2] = 3;
  p[3] = 5;
  p[4] = 7;
  p[5] = 13;
  p[6] = 17;
  p[7] = 19;
  p[8] = 31;
  p[9] = 61;
  p[10] = 89;
  p[11] = 107;
  p[12] = 127;
  p[13] = 521;
  p[14] = 607;
  p[15] = 1279;
  p[16] = 2203;
  p[17] = 2281;
  p[18] = 3217;
  p[19] = 4253;
  p[20] = 4423;
  p[21] = 9689;
  p[22] = 9941;
  p[23] = 11213;
  p[24] = 19937;
  p[25] = 21701;
  p[26] = 23209;
  p[27] = 44497;
  p[28] = 86243;
  p[29] = 110503;
  p[30] = 132049;
  p[31] = 216091;
  p[32] = 756839;
  p[33] = 859433;
  p[34] = 1257787;
  p[35] = 1398269;
  p[36] = 2976221;
  p[37] = 3021377;
  p[38] = 6972593;
  p[39] = 13466917;
  p[40] = 20996011;
  p[41] = 24036583;
  int ans = binpow(2, p[n] - 1);
  ans--;
  if (ans < 0) ans += mod;
  cout << ans << endl;
}
int main() {
  while (cin >> n) {
    solve();
  }
}
