#include #include #include using namespace std; using ll = long long; #define REP(i, n) for(ll i=0; i<(n);i++) ll mod = 998244353; vector c, dp; ll getind(vector & p) { ll res = 0; REP(i, c.size()) { res *= (c[i] + 1); res += p[i]; } return res; } void solve2(ll i, vector& ar, vector& mx, ll mul = 1) { if (i == c.size()) { ll imx = getind(mx); ll iar = getind(ar); if (imx == iar)return; dp[imx] += dp[iar] * mul; dp[imx] %= mod; return; } for (ar[i] = mx[i]; ar[i] >= 0; ar[i]--) solve2(i + 1, ar, mx, ar[i] != mx[i] ? mul : mul * (mx[i] + 1) % mod); } void solve(ll i, vector& ar) { if (i == c.size()) { vector ar2(c.size()); solve2(0, ar2, ar, 1); return; } for (ar[i] = 0; ar[i] <= c[i]; ar[i]++) solve(i + 1, ar); } int main() { ll n; cin >> n; ll rev = -1; while (1) { bool find = false; for (ll v = 2; v * v <= n; v++) { if (n % v)continue; if (rev == v)c.back()++; else c.push_back(1); n /= v; rev = v; find = true; break; } if (!find) { if (n == rev)c.back()++; else c.push_back(1); break; } } dp.resize(getind(c) + 1); dp[0] = 1; vector ar(c.size()); solve(0, ar); cout << dp.back(); return 0; }