#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1111111;
const long long Md = 998244353;
int n, m;
long long fac[MAXN], ifa[MAXN], inv[MAXN];
long long ans;
inline long long C(int x, int y) {
  return fac[x] * ifa[y] % Md * ifa[x - y] % Md;
}
int main() {
  scanf("%d", &n);
  if (n == 1) {
    puts("1");
    return 0;
  }
  if (n == 2) {
    puts("2");
    return 0;
  }
  fac[0] = fac[1] = ifa[0] = ifa[1] = 1;
  inv[0] = inv[1] = 1;
  for (int i = 2; i <= n; ++i) {
    inv[i] = inv[Md % i] * (Md - Md / i) % Md;
    fac[i] = fac[i - 1] * (long long)i % Md;
    ifa[i] = ifa[i - 1] * inv[i] % Md;
  }
  for (int i = 1; i <= n; ++i) {
    ans += C(n, n - i + 1) * (fac[n - i + 1] - 1) % Md * fac[i - 1] % Md;
    if (ans >= Md) ans -= Md;
    if (ans < 0) ans += Md;
  }
  ++ans;
  printf("%lld\n", ans % Md);
  return 0;
}
