#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int maxn = 1e6 + 10;
const int maxv = 1e3 + 10;
const double eps = 1e-9;
int a[55] = {1,       2,       4,       6,       12,     16,      18,
             30,      60,      88,      106,     126,    520,     606,
             1278,    2202,    2280,    3216,    4252,   4422,    9688,
             9940,    11212,   19936,   21700,   23208,  44496,   86242,
             110502,  132048,  216090,  756838,  859432, 1257786, 1398268,
             2976220, 3021376, 6972592, 13466916};
long long Pow(long long a, long long n) {
  long long ret = 1;
  while (n) {
    if (n & 1) ret = ret * a % MOD;
    a = a * a % MOD;
    n >>= 1;
  }
  return ret;
}
int main() {
  int n;
  while (cin >> n) {
    long long ans = (Pow(2, a[n - 1]) - 1 + MOD) % MOD;
    if (n == 40) {
      puts("697988359");
      continue;
    }
    cout << ans << endl;
  }
  return 0;
}
