#include <bits/stdc++.h>
using namespace std;
int const N = 1e6 + 1;
long long const m = 998244353;
long long factorialNumInverse[N + 1];
long long naturalNumInverse[N + 1];
long long fact[N + 1];
void InverseofNumber(long long p) {
  naturalNumInverse[0] = naturalNumInverse[1] = 1;
  for (int i = 2; i <= N; i++)
    naturalNumInverse[i] = naturalNumInverse[p % i] * (p - p / i) % p;
}
void InverseofFactorial(long long p) {
  factorialNumInverse[0] = factorialNumInverse[1] = 1;
  for (int i = 2; i <= N; i++)
    factorialNumInverse[i] =
        (naturalNumInverse[i] * factorialNumInverse[i - 1]) % p;
}
void factorial(long long p) {
  fact[0] = 1;
  for (int i = 1; i <= N; i++) {
    fact[i] = (fact[i - 1] * i) % p;
  }
}
int main() {
  InverseofNumber(m);
  InverseofFactorial(m);
  factorial(m);
  long long n;
  cin >> n;
  long long nf = fact[n];
  long long B = 0;
  for (int k = 1; k < n; k++) {
    B = (B + (factorialNumInverse[k] * nf) % m) % m;
  }
  long long A = (n * nf) % m;
  long long res = A - B;
  if (res < 0) res += m;
  cout << res << "\n";
  return 0;
}
