#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
long long fact[1000100];
long long binpow(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = (res * x) % MOD;
    x = (x * x) % MOD;
    y >>= 1;
  }
  return res;
}
long long n;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  fact[0] = 1;
  for (long long i = 1; i <= n; i++) {
    fact[i] = (fact[i - 1] * 1ll * i) % MOD;
  }
  long long sum = fact[n] * n % MOD;
  for (int i = 1; i < n; i++) {
    sum = (sum - fact[n] * binpow(fact[i], MOD - 2) % MOD + MOD) % MOD;
  }
  cout << sum;
}
