#include <bits/stdc++.h>
using namespace std;
long long n, ans, tmp, a[1001000];
long long mod = 998244353;
long long pow_(long long a, long long n) {
  long long ret = 1ll;
  while (n) {
    if (n & 1) {
      ret = 1ll * ret * a;
      ret %= mod;
    }
    a = 1ll * a * a;
    a %= mod;
    n >>= 1;
  }
  return ret % mod;
}
void init() {
  a[0] = 1;
  for (long long i = 1; i <= 1e6; i++) a[i] = (a[i - 1] * i) % mod;
}
int main() {
  init();
  scanf("%lld", &n);
  ans = a[n];
  for (long long i = 1; i <= n; i++) {
    tmp = a[n] * pow_(a[n - i], mod - 2) % mod;
    tmp %= mod;
    tmp *= 1ll * (a[n - i] - 1) % mod;
    tmp %= mod;
    ans += tmp;
    ans %= mod;
  }
  ans %= mod;
  printf("%lld\n", (ans + mod) % mod);
  return 0;
}
