#include <bits/stdc++.h>
using namespace std;
double pi = acos(-1.0);
const double eps = 1e-12;
const int inf = 0x3f3f3f3f;
const int maxn = 2e6 + 20;
const int maxm = 5e3 + 20;
inline int in(int &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return -1;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
long long mod = 998244353;
long long f[maxn];
long long inv[maxn];
long long upd(long long &a, long long b) {
  b %= mod;
  a += b;
  if (a >= mod) a -= mod;
}
long long qpow(long long x, long long k) {
  long long r = 1;
  for (; k;) {
    if (k & 1) r = r * x % mod;
    x = x * x % mod;
    k >>= 1;
  }
  return r;
}
int main() {
  f[0] = 1;
  for (int i = 1; i <= 1000000; ++i) f[i] = f[i - 1] * i % mod;
  inv[1000000] = qpow(f[1000000], mod - 2);
  for (int i = 999999; i >= 0; --i) inv[i] = inv[i + 1] * (i + 1) % mod;
  int n;
  scanf("%d", &n);
  if (n == 1) return 0 * puts("1");
  if (n == 2) return 0 * puts("2");
  long long ans = 0;
  int st = 1;
  int ed = 2;
  for (int i = n - 1, _ = 0; i >= 1; ++_, --i) {
    long long cnt = f[n - 1] * inv[ed] % mod;
    cnt = cnt * st % mod;
    cnt = cnt * n % mod;
    cnt = cnt * i % mod;
    ++st, ++ed;
    upd(ans, cnt);
  }
  upd(ans, 1);
  printf("%lld\n", ans);
  return 0;
}
