#include <bits/stdc++.h>
using namespace std;
unsigned long long a[] = {
    2,         4,         16,        64,        4096,      65536,     262144,
    73741817,  536396504, 140130951, 487761806, 319908071, 106681875, 373391777,
    317758024, 191994804, 416292237, 110940210, 599412199, 383601261, 910358879,
    532737551, 348927937, 923450986, 470083778, 642578562, 428308067, 485739299,
    419990028, 287292017, 202484168, 389339972, 848994101, 273206870, 853092283,
    411696553, 876153854, 90046025,  828945524, 697988360};
int main() {
  int n;
  cin >> n;
  cout << a[n - 1] - 1 << endl;
  return 0;
}
