#include using namespace std; const long long MOD = 998244353; class sieve { vector f; public: sieve(int n) { f.resize(n+1); for (int i = 0; i <= n; i++) f[i] = i; for (int i = 2; i <= n; i++) { if (f[i] != i) continue; for (int j = 2 * i; j <= n; j += i) f[j] = i; } } map factorize(int n) { map ret; while (n > 1) { int p = f[n]; while (n % p == 0) { n /= p; ++ret[p]; } } return ret; } }; long long modpow(long long x, long long p, long long mod) { long long ret = 1; while (p) { if (p & 1) ret = ret * x % mod; x = x * x % mod; p >>= 1; } return ret; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; sieve s(n); long long ret = 1; int maxp = 1; for (int i = 1; i <= n; i++) { auto f = s.factorize(i); if (f.size() == 1) { int p = f.begin()->first; ret = ret * p % MOD; maxp = max(maxp, p); } } ret = ret * modpow(maxp, MOD-2, MOD) % MOD; cout << ret << endl; return 0; }