#include <bits/stdc++.h>
long long powmod(long long b, int e) {
  if (e == 1) return b;
  if (e & 1) return powmod(b * b % 998244353, e / 2) * b % 998244353;
  return powmod(b * b % 998244353, e / 2);
}
int n;
long long f[1000005];
long long weird = 0;
int main() {
  scanf("%d", &n);
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i] = (f[i - 1] * i) % 998244353;
  }
  for (int i = 1; i < n; i++) {
    weird += powmod(f[i], 998244353 - 2);
  }
  weird = (n - weird) % 998244353 + 998244353;
  printf("%I64d\n", weird * f[n] % 998244353);
}
