#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000500;
const int MAXE = 400400;
const int INF = 0x3f3f3f3f;
template <typename T>
inline void CheckMax(T &A, T B) {
  A < B ? A = B : A;
}
template <typename T>
inline void CheckMin(T &A, T B) {
  A > B ? A = B : A;
}
template <typename T>
inline void read(T &x) {
  int c = getchar();
  bool f = false;
  for (x = 0; !isdigit(c); c = getchar()) {
    if (c == '-') {
      f = true;
    }
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  if (f) {
    x = -x;
  }
}
long long n, m;
long long P[MAXN], cnt;
const long long mod = 998244353;
long long fac[MAXN + 10], inv[MAXN + 10];
void init() {
  fac[0] = 1;
  for (long long i = 1; i < MAXN; i++) fac[i] = fac[i - 1] * i % mod;
  inv[0] = inv[1] = 1;
  for (int i = 2; i < MAXN; i++) inv[i] = (mod - mod / i) * inv[mod % i] % mod;
  for (int i = 1; i < MAXN; i++) inv[i] = inv[i] * inv[i - 1] % mod;
}
long long C(long long a, long long b) {
  return (fac[a] * inv[b] % mod * inv[a - b] % mod);
}
signed main() {
  cin >> n;
  long long ans = 1LL;
  init();
  for (long long i = 0; i <= n; i++) {
    ans = (ans + (C(n, i) * (fac[i] * fac[n - i] % mod - fac[i] + mod) % mod)) %
          mod;
  }
  printf("%I64d\n", (ans + mod) % mod);
  return 0;
}
