#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
long long mininum = 0;
long long a = 1;
int n;
template <typename T>
inline void read(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + ch - '0';
  x *= f;
}
int main() {
  read(n);
  if (n == 1) {
    printf("1");
    return 0;
  }
  for (register int i = 2; i <= n; ++i) {
    a = (a * i) % mod;
    mininum = (mininum * (i - 1)) + 1;
    mininum %= mod;
  }
  printf("%I64d", 1ll * (a - mininum + mod) * n % mod);
  return 0;
}
