#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
long long bpow(long long x, long long y) {
  if (y == 0) {
    return 1;
  }
  long long result = bpow(x, y / 2);
  return result * result % MOD * (y % 2 == 1 ? x : 1) % MOD;
}
int32_t main() {
  long long n;
  cin >> n;
  vector<long long> fact(n + 1);
  fact[0] = 1;
  for (long long i = 1; i <= n; ++i) {
    fact[i] = (fact[i - 1] * i) % MOD;
  }
  vector<long long> C(n + 1);
  C[0] = 1;
  for (long long i = 1; i <= n; ++i) {
    C[i] = fact[n] * bpow(fact[i], MOD - 2) % MOD * bpow(fact[n - i], MOD - 2) %
           MOD;
  }
  long long answer = (n * fact[n] % MOD - (n - 1) + MOD) % MOD;
  vector<long long> f(n + 2);
  for (long long i = 1; i <= n; ++i) {
    f[i] = C[i] * fact[n - i] % MOD;
  }
  f[n + 1] = 0;
  for (long long i = 1; i < n; ++i) {
    answer = (answer - (f[i] - f[i + 1] + MOD) % MOD * i % MOD + MOD) % MOD;
  }
  cout << answer << '\n';
  return 0;
}
