#include <bits/stdc++.h>
using namespace std;
const int P = 998244353;
int power(int n, int k) {
  if (!k) return 1;
  int ans = power(n, k / 2);
  ans = 1LL * ans * ans % P;
  if (k & 1) ans = 1LL * ans * n % P;
  return ans;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  int ans = 1, tmp = 1;
  for (int i = 1; i < n; i++) tmp = 1LL * tmp * i % P;
  for (int i = n - 2, k = n; ~i; i--) {
    tmp = 1LL * tmp * power(i + 1, P - 2) % P;
    k = 1LL * k * (i + 1) % P * power(n - i, P - 2) % P;
    (ans += 1LL * tmp * k % P * (n - i - 1) % P * (i + 1) % P) %= P;
  }
  cout << ans << endl;
  return 0;
}
