#include <bits/stdc++.h>
using namespace std;
long long facs[1000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long nfact = 1;
  for (int x = (2); x <= (n); x++) {
    nfact = (x * nfact) % 998244353;
  }
  long long ans = nfact;
  long long fact = 1;
  for (int b = (n - 1); b >= 2; b--) {
    fact = (fact * (b + 1)) % 998244353;
    ans = (ans + (nfact - fact)) % 998244353;
  }
  cout << (ans + 998244353) % 998244353 << "\n";
  return 0;
}
