#include // #include // using namespace atcoder; #define rep(i,n) for(int i=0;i inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } templateauto MAX(const T& a) { return *max_element(a.begin(),a.end()); } templateauto MIN(const T& a) { return *min_element(a.begin(),a.end()); } templateU SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); } templateU COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); } templateint LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); } templateint UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); } int GCD(int a, int b) { return b ? GCD(b, a%b) : a; } int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; } typedef long double ld; typedef unsigned long long int ull; typedef pair P; typedef vector vi; typedef vector vc; typedef vector vb; typedef vector vd; typedef vector vs; typedef vector vll; typedef vector> vpii; typedef vector> vpll; typedef vector vvi; typedef vector vvvi; typedef vector vvc; typedef vector vvs; typedef vector vvll; typedef map mii; typedef set si; //--------------------------------------------------------------------------------------------------- ll prime_factorize(ll n) { ll res = 1; for (ll p = 2;p*p <= n;++p) { if (n%p!=0) continue; ll num = 0; while(n%p ==0) { ++num; n/=p; } res+= num; } if (n!=1) res++; return res; } bool isPrime(int x){ int i; if(x < 2)return 0; else if(x == 2) return 1; if(x%2 == 0) return 0; for(i = 3; i*i <= x; i += 2) if(x%i == 0) return 0; return 1; } int main(void){ // Your code here! ll n; cin >> n; if (n== 2) { cout << 1 << endl; return 0; } if (n == 3) { cout << 2 << endl; return 0; } if (n == 4) { cout << 4 << endl; return 0; } // FOR(i,1,n) { // if (prime_factorize(i) >= n-1) { // cout << i << endl; // return 0; // } // } vi prime_vector; FOR(i,2,100000) { if (isPrime(i)) prime_vector.push_back(i); } ll ans = 1; ll count = 1; for(auto x:prime_vector) { if (count >= n - 1) { cout << ans << endl; break; } count*=2; ans *= x; ans %= MOD; } }