#include #include using namespace std; #include using namespace atcoder; using mint = modint998244353; int main(){ int n; cin >> n; vector f(n, 0); vector> d(n + 1); for(int i = 1; i <= n; i++){ for(int j = i; j <= n; j += i){ d[j].emplace_back(i); } } mint tot = 0; for(int i = 3; i <= n; i++){ mint sum = tot; for(int j: d[i]){ sum -= f[j]; } f[i] = (sum / i + 1) * i / (i - d[i].size()); tot += f[i]; for(int j: d[i]){ tot -= f[j]; f[j] = f[i]; tot += f[j]; } } cout << f[n].val() << endl; }