#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2100000;
const int mod = 998244353;
int n;
long long jc[Maxn], ans;
long long powp(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
long long C(int x, int y) {
  return jc[x] * powp(jc[y], mod - 2) % mod * powp(jc[x - y], mod - 2) % mod;
}
int main() {
  scanf("%d", &n);
  jc[0] = 1;
  for (int i = 1; i <= n; i++) jc[i] = jc[i - 1] * i % mod;
  for (int i = 0; i <= n; i++)
    ans = (ans + C(n, i) * (jc[i] - 1) % mod * jc[n - i] % mod) % mod;
  ans = (ans + 1) % mod;
  printf("%I64d\n", ans);
  return 0;
}
