#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int mod = 998244353;
int fact[N];
int mul(int a, int b) { return ((long long)(a % mod) * (b % mod)) % mod; }
int add(int a, int b) { return ((a % mod) + (b % mod)) % mod; }
int fastpow(int base, int power) {
  if (!power) return 1;
  int ret = fastpow(base, power / 2);
  ret = mul(ret, ret);
  if (power & 1) ret = mul(ret, base);
  return ret;
}
int npr(int n, int r) { return mul(fact[n], fastpow(fact[n - r], mod - 2)); }
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  fact[0] = 1;
  for (int i = 1; i < N; i++) fact[i] = mul(fact[i - 1], i);
  int n;
  cin >> n;
  int ans = n;
  int mult = n - 2;
  int r = 1;
  for (int i = 2; i <= n - 1; i++) {
    ans = add(ans, mul(i, mul(mult, npr(n, r))));
    r++;
    mult--;
  }
  cout << ans;
  return 0;
}
