#include using namespace std; const long long MOD = 998244353; /// エラトステネスの篩 struct Eratosthenes { vector is_prime; /// nまでの素数一覧 vector primes; /// 整数xを割り切る最小の素数 vector min_prime_can_divide_x; Eratosthenes(const int n) { min_prime_can_divide_x.resize(n + 1); is_prime.assign(n + 1, true); is_prime[0] = is_prime[1] = false; min_prime_can_divide_x[0] = min_prime_can_divide_x[1] = 1; for (int i = 2; i <= n; i++) { if (is_prime[i]) { for (int j = 2 * i; j <= n; j += i) { is_prime[j] = false; if (min_prime_can_divide_x[j] == 0) min_prime_can_divide_x[j] = i; } primes.push_back(i); min_prime_can_divide_x[i] = i; } } } /** * xの素因数の種類を取得 * @param x n以下の数値を指定する必要がある */ set get_prime_factors(int x) { set s; while (x > 1) { s.insert(min_prime_can_divide_x[x]); x /= min_prime_can_divide_x[x]; } return s; } /** * xの素因数とその数を取得 * @param x n以下の数値を指定する必要がある */ map get_prime_factor_and_cnt(int x) { map mp; while (x > 1) { mp[min_prime_can_divide_x[x]]++; x /= min_prime_can_divide_x[x]; } return mp; } }; signed main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; auto e = Eratosthenes(n); auto ma = e.primes.back(); map mp; for (int i = 1; i <= n; i++) { if (ma == i) continue; auto tmp = e.get_prime_factor_and_cnt(i); for (auto e : tmp) { mp[e.first] = max(mp[e.first], e.second); } } long long ans = 1; for (auto e : mp) { for (int i = 0; i < e.second; i++) { (ans *= e.first) %= MOD; } } cout << ans << endl; }