#include <bits/stdc++.h>
using namespace std;
int tt;
#pragma GCC optimize("O1")
#pragma GCC optimize("O2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
const int N = 1000002;
const long long M = 998244351;
const long long mod = 998244353;
const int mod1 = (1 << 16);
const int mod2 = (1 << 30);
long long binpow(long long n, long long k) {
  if (k == 0) return 1LL;
  if (k == 1) return n;
  if (k % 2 == 0) {
    long long cur = binpow(n, k / 2);
    return (cur * cur) % mod;
  }
  long long cur = binpow(n, k / 2);
  cur = (cur * cur) % mod;
  cur = (cur * n) % mod;
  return cur % mod;
}
long long fact[N], n, ans, i;
void solve() {
  cin >> n;
  fact[0] = 1LL;
  for (i = 1; i <= n + 1; i++) fact[i] = (fact[i - 1] * i) % mod;
  fact[n] = fact[n] % mod;
  ans = fact[n];
  for (i = 2; i <= (n - 1); i++) {
    long long skizb = (binpow(fact[i], M) * fact[n]) % mod;
    skizb = (skizb * (n - i)) % mod;
    skizb = (skizb * (i - 1)) % mod;
    ans = (ans % mod + skizb) % mod;
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  for (tt = 1; tt <= t; tt++) {
    solve();
  }
}
