#include <bits/stdc++.h>
const int maxn = 1000002;
int n;
int f[maxn] = {1}, inv[maxn] = {1, 1};
int C(int a, int b) {
  if (b < 0 || b > a) return 0;
  return 1LL * f[a] * inv[b] % 998244353 * inv[a - b] % 998244353;
}
int main() {
  scanf("%d", &n);
  f[0] = 1;
  for (register int i = 2; i <= n; ++i)
    inv[i] =
        (998244353 - 1LL * 998244353 / i * inv[998244353 % i] % 998244353) %
        998244353;
  for (register int i = 1; i <= n; ++i) {
    f[i] = 1LL * f[i - 1] * i % 998244353;
    inv[i] = 1LL * inv[i - 1] * inv[i] % 998244353;
  }
  int ans = f[n];
  for (register int i = 1; i <= n; ++i)
    ans =
        (ans + 1LL * C(n, i) * f[i] % 998244353 * (f[n - i] - 1) % 998244353) %
        998244353;
  printf("%d", ans);
  return 0;
}
