#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> fact(n + 1);
  fact[0] = 1;
  for (int i = 1; i <= n; i++) {
    fact[i] = fact[i - 1] * i % 998244353;
  }
  long long ans = fact[n];
  long long now = n;
  for (int i = 0; i < n; i++) {
    ans = (ans +
           (fact[n - i - 1] - 1 + 998244353) % 998244353 * now % 998244353) %
          998244353;
    now = now * (n - i - 1) % 998244353;
  }
  cout << ans << endl;
  return 0;
}
