#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
void solve() {
  long long n;
  cin >> n;
  long long fact[n + 1], ifact[n + 1];
  fact[0] = 1, ifact[n] = 1;
  for (long long i = 1; i <= n; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
  }
  for (long long i = n - 1; i >= 0; i--) {
    ifact[i] = (ifact[i + 1] * (i + 1)) % mod;
  }
  long long ans = (n * fact[n]) % mod;
  long long res = 0;
  for (int i = 1; i < n; i++) {
    res = (res + ifact[i]) % mod;
  }
  cout << (ans - res + mod) % mod << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
