#include <bits/stdc++.h>
using namespace std;
const int Mod(998244353);
int fac[1000003], inv[1000003];
int fexp(int x, int k) {
  int res = 1;
  for (; k; k >>= 1, x = (unsigned long long)x * x % Mod)
    if (k & 1) res = (unsigned long long)res * x % Mod;
  return res;
}
int A(int n, int i) { return (unsigned long long)fac[n] * inv[n - i] % Mod; }
int main() {
  int n, ans;
  scanf("%d", &n);
  for (int i = fac[0] = 1; i <= n; i++)
    fac[i] = (unsigned long long)fac[i - 1] * i % Mod;
  inv[n] = fexp(fac[n], Mod - 2);
  for (int i = n; i; i--) inv[i - 1] = (unsigned long long)inv[i] * i % Mod;
  ans = (unsigned long long)fac[n] * (n + 1) % Mod;
  for (int i = 1; i <= n; i++) ans = (ans - A(n, i) + Mod) % Mod;
  printf("%d\n", ans);
  return 0;
}
