#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int MOD = 998244353;
int n;
int fact[N], rfact[N];
int _sum(int, int);
int _mul(int, int);
int _neg(int);
int _pow(int, int);
int choose(int, int);
int32_t main() {
  cin >> n;
  fact[0] = 1;
  for (int i = 1; i <= n; i++) fact[i] = _mul(fact[i - 1], i);
  for (int i = 0; i <= n; i++) rfact[i] = _pow(fact[i], MOD - 2);
  int ans = fact[n];
  for (int i = 1; i < n; i++) {
    int cans = choose(i, n);
    cans = _mul(cans, fact[n - i]);
    cans = _mul(cans, _sum(fact[i], _neg(1)));
    ans = _sum(ans, cans);
  }
  cout << ans << endl;
}
int choose(int a, int b) { return _mul(fact[b], _mul(rfact[a], rfact[b - a])); }
int _sum(int a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
  return a;
}
int _mul(int a, int b) { return 1LL * a * b % MOD; }
int _neg(int a) { return a > 0 ? MOD - a : 0; }
int _pow(int a, int b) {
  if (b == 0) return 1;
  int nxt = _pow(a, b / 2);
  nxt = _mul(nxt, nxt);
  if (b & 1) nxt = _mul(nxt, a);
  return nxt;
}
