#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
const long long MOD = 998244353;
int n;
long long factor[MAXN];
long long ifactor[MAXN];
long long mult(long long a, long long b) { return a * b % MOD; }
void getfactor() {
  factor[0] = 1;
  for (int ii = 1; ii <= n; ii++) {
    factor[ii] = mult(factor[ii - 1], ii);
  }
  ifactor[n] = 1;
  for (int ii = n - 1; ii >= 1; ii--) {
    ifactor[ii] = mult(ifactor[ii + 1], ii + 1);
  }
}
int main() {
  cin >> n;
  getfactor();
  long long ans = mult(n, factor[n]);
  for (int ii = 1; ii <= n - 1; ii++) {
    ans = (ans - ifactor[ii] + MOD) % MOD;
  }
  cout << ans;
}
