#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
const int MAX = 1123456;
long long fact[MAX];
long long inv_fact[MAX];
long long fast_pow(long long base, long long exp) {
  if (exp == 0) return 1;
  if (exp == 1) return base;
  long long ret = fast_pow(base, exp / 2);
  ret = (ret * ret) % MOD;
  if (exp % 2 == 1) ret = (ret * base) % MOD;
  return ret;
}
void init() {
  fact[0] = 1;
  fact[1] = 1;
  inv_fact[0] = 1;
  inv_fact[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fact[i] = (fact[i - 1] * i) % MOD;
    inv_fact[i] = (inv_fact[i - 1] * fast_pow(i, MOD - 2)) % MOD;
  }
}
int main() {
  init();
  int n;
  cin >> n;
  long long ans = (n * fact[n]) % MOD;
  long long sum = 0;
  for (int k = 1; k < n; k++) {
    long long aux = (fact[n] * inv_fact[k]) % MOD;
    sum = (sum + aux) % MOD;
  }
  ans = (ans - sum) % MOD;
  ans = (ans + MOD) % MOD;
  cout << ans << endl;
}
