#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long MAX = 1e6 + 5;
long long fact[MAX];
long long inv[MAX];
long long fastPow(long long a, long long b, long long c) {
  if (b == 0) {
    return 1;
  }
  long long temp = fastPow(a, b / 2, c);
  temp = (temp * temp) % c;
  return (b % 2 == 0) ? temp : (a % c * temp) % c;
}
long long modInverse(long long a, long long m) { return fastPow(a, m - 2, m); }
void doit() {
  long long n;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return;
  }
  if (n == 2) {
    cout << 2 << endl;
    return;
  }
  fact[0] = 1;
  for (long long i = 1; i <= n; i++) {
    fact[i] = (fact[i - 1] * (i)) % mod;
    inv[i] = modInverse(fact[i], mod);
  }
  long long resp = (n - 1) * fact[n] % mod;
  for (long long i = 3; i <= n; i++) {
    long long aux = (fact[n] * inv[i - 1]) % mod;
    resp = (resp - aux + mod) % mod;
  }
  cout << resp << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T = 1;
  while (T--) {
    doit();
  }
  return 0;
}
