#include using namespace std; using ll = long long; #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++) /* --------- ここから --------- */ struct osa_k { using _ll = long long; #define PRIME_FACTORIZE_MAX 1000010 vector<_ll> primes; osa_k() { primes.resize((PRIME_FACTORIZE_MAX)); for(_ll i = 0; i < PRIME_FACTORIZE_MAX; i++) { primes[i] = 1; } for(_ll i = 2; i < PRIME_FACTORIZE_MAX; i++) { if(primes[i] != 1) continue; for(_ll j = i; j <= PRIME_FACTORIZE_MAX; j += i) { primes[j] = i; } } } vector> factorize(_ll n){ vector> res; while(n != 1) { _ll cur = primes[n]; _ll cnt = 0; while(n % cur == 0) { n /= cur; cnt++; } res.push_back({cur, cnt}); } reverse(res.begin(), res.end()); return res; } } osa_k; vector>factorize(long long n) { return osa_k.factorize(n); } /* --------- ここまで --------- */ void solve() { ll n; cin >> n; ll mx = 1; for(ll i = n; i >= 2; i--) { if(osa_k.primes[i] == i) { mx = i; break; } } map mp; rep(i, 2, n+1) { if(mx == i) continue; auto v = factorize(i); for(auto [a, p] : v) mp[a] = max(mp[a], p); } const ll mod = 998244353; auto P = [&](ll a, ll p) { ll x = a, res = 1; while(p) { if(p & 1) (res *= x) %= mod; (x *= x) %= mod; p /= 2; } return res; }; ll ans = 1; for(auto [a, p] : mp) { (ans *= P(a, p)) %= mod; } cout << ans << endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); solve(); return 0; }