#include <bits/stdc++.h>
const int N = 1e6 + 10;
int n;
long long inv[N], ans;
long long fac[N], iinv[N];
inline long long poww(long long x, long long y) {
  long long sum = 1;
  while (y) {
    if (y & 1) sum = sum * x % 998244353;
    x = x * x % 998244353;
    y >>= 1;
  }
  return sum % 998244353;
}
int main(void) {
  scanf("%d", &n);
  inv[1] = 1;
  fac[1] = 1;
  for (int i = 2; i <= n; i++) {
    fac[i] = (long long)fac[i - 1] * i % 998244353;
    inv[i] = (long long)poww(fac[i], 998244353 - 2);
  }
  for (int i = 1; i <= n; i++)
    ans = (ans +
           (fac[n] - (fac[n] * inv[i]) % 998244353 + 998244353) % 998244353) %
          998244353;
  printf("%I64d\n", ans + 1);
  return 0;
}
