#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
const long double EPS = 1e-10;
const int dyx[4][2] = {{0, 1}, {-1, 0}, {0, -1}, {1, 0}};
int main() {
  long long n;
  cin >> n;
  long long ans = 0LL, total = 0LL, perm = 1LL, diff;
  for (long long i = 0; i <= n - 2; ++i) {
    perm = (perm * (n - i)) % MOD;
    diff = (perm - total + MOD) % MOD;
    ans += ((i + 1) * diff) % MOD;
    ans %= MOD;
    total = (total + diff) % MOD;
  }
  cout << max(1LL, ans) << "\n";
}
