#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
long long bin_pow(long long x, long long pw) {
  if (pw == 1) return x % mod;
  long long y = bin_pow(x, pw / 2);
  if (pw % 2 == 1)
    return (((x * y) % mod) * y) % mod;
  else
    return (y * y) % mod;
}
long long rev(long long x) { return bin_pow(x, mod - 1); }
int main() {
  long long n = 0;
  cin >> n;
  vector<long long> fact(n + 1), C(n + 1);
  fact[0] = 1;
  C[0] = 1;
  for (long long i = 1; i <= n; ++i) {
    fact[i] = fact[i - 1] * i % mod;
    C[i] = C[i - 1] * (n - i + 1) * rev(i) % mod;
  }
  long long ans = fact[n];
  for (int k = 1; k < n; ++k)
    ans = (ans + C[k] * (fact[n - k] - 1) % mod) % mod;
  cout << ans << '\n';
}
