#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
map<long long, long long> memo;
vector<long long> factorial;
long long power(long long a, long long x) {
  if (x == 0) return 1;
  long long mid = power(a, x / 2);
  long long res = (mid * mid) % MOD;
  if (x % 2) res = (res * a) % MOD;
  return res;
}
long long inverse(long long a) {
  if (!memo.count(a)) {
    memo[a] = power(a, MOD - 2);
  }
  return memo[a];
}
int main() {
  ios_base::sync_with_stdio(false);
  long long n;
  cin >> n;
  factorial.resize(n + 47);
  factorial[0] = 1;
  for (long long i = 1; i < n + 47; i++)
    factorial[i] = (factorial[i - 1] * i) % MOD;
  long long res = 1;
  for (long long i = 2; i <= n; i++) {
    long long curr = factorial[n];
    curr = (curr * (factorial[i] - 1)) % MOD;
    curr = (curr * inverse(factorial[i])) % MOD;
    res = (res + curr) % MOD;
  }
  cout << res << "\n";
}
