#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 7, MOD = 998244353;
long long int n, fact[MAX], ans;
long long int powMod(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % MOD;
    b >>= 1;
    a = (a * a) % MOD;
  }
  return res;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  fact[0] = fact[1] = 1;
  for (long long int i = 2; i < MAX; i++) {
    fact[i] = (fact[i - 1] * i) % MOD;
  }
  cin >> n;
  ans = (n * fact[n]) % MOD;
  for (long long int i = 1; i < n; i++) {
    ans -= (fact[n] * powMod(fact[i], MOD - 2)) % MOD;
    ans = (ans + MOD) % MOD;
  }
  cout << ans;
  return 0;
}
