#include using namespace std; struct iofast_t { iofast_t() { ios::sync_with_stdio(false); cin.tie(nullptr); } } iofast; struct uns_t {} uns; template auto vec(Element init, Head arg, Args ...args) { if constexpr (sizeof...(Args) == 0) return vector(arg, init); else return vector(arg, vec(init, args...)); } template auto vec(uns_t, Head arg, Args ...args) { return vec(Element(), arg, args...); } template auto distance(const Container &c, decltype(begin(c)) iter) { return distance(begin(c), iter); } template ::value_type>> auto isort(RIter first, RIter last, Compare comp = Compare()) { vector i(distance(first, last)); iota(begin(i), end(i), 0); sort(begin(i), end(i), [&](auto x, auto y) { return comp(*(first + x), *(first + y)); }); return i; } template typename, typename = void_t<>> struct detect : false_type {}; template typename Check> struct detect>> : true_type {}; template typename Check> constexpr inline bool detect_v = detect::value; template using has_member_sort = decltype(declval().sort()); template > auto sorted(Container c, Compare comp = Compare()) { if constexpr (detect_v) { c.sort(comp); return c; } else { sort(begin(c), end(c), comp); return c; } } template > auto uniqued(Container c, Compare comp = Compare()) { c.erase(unique(begin(c), end(c), comp), end(c)); return c; } template > T &chmin(T &l, T r, Compare &&f = less()) { return l = min(l, r, f); } template > T &chmax(T &l, T r, Compare &&f = less()) { return l = max(l, r, f); } template constexpr auto fix(F &&f) noexcept { return [f = std::tuple(std::forward(f))](auto &&...args) mutable { return std::get<0>(f)(fix(std::get<0>(f)), std::forward(args)...); }; } #include using mint = atcoder::modint998244353; int main() { int64_t n; cin >> n; auto prime_factor = [](int64_t n) { auto pf = vec>(uns, 0); for (int i = 2; i <= n / i; ++i) { if (n % i != 0) { continue; } int count = 0; while (n % i == 0) { ++count; n /= i; } pf.push_back({ i, count }); } if (n != 1) { pf.push_back({ n, 1 }); } return pf; }; auto pf = prime_factor(n); auto prime_factor_ = [&](int64_t d) { auto pf_ = vec>(uns, 0); for (auto [p, _] : pf) { if (d % p != 0) { continue; } int c = 0; while (d % p == 0) { d /= p; ++c; } pf_.push_back({ p, c }); } return pf_; }; auto make_limit = [](const auto &pf) { auto limit = vec(uns, size(pf)); for (size_t i = 0; i < size(pf); ++i) { auto [p, c] = pf[i]; limit[i] = 1; while (c--) { limit[i] *= p; } } return limit; }; int log2 = 0; while ((INT64_C(1) << log2) <= n) { ++log2; } auto div = vec(uns, 0); for (int i = 1; i <= n / i; ++i) { if (n % i != 0) { continue; } div.push_back(i); div.push_back(n / i); } div = uniqued(sorted(move(div))); unordered_map dp; dp[1] = 1; for (auto lcm : div) { if (lcm == 1) { continue; } auto pf = prime_factor_(lcm); auto limit = make_limit(pf); mint sum = 0; for (auto x : div) { if (lcm % x != 0 || lcm == x) { continue; } mint acc = 1; for (size_t i = 0; i < size(pf); ++i) { if (x % limit[i] == 0) { acc *= get<1>(pf[i]) + 1; } } sum += dp[x] * acc; } dp[lcm] = sum; } cout << dp[n].val() << endl; }