#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const long long mod = 998244353;
long long p[N];
int main() {
  int n;
  long long ans;
  scanf("%d", &n);
  p[0] = 1;
  for (int i = 1; i <= n; i++) p[i] = p[i - 1] * (n - i + 1) % mod;
  ans = p[1];
  for (int i = 2; i <= n; i++) {
    ans += (p[i] - p[i - 1] + mod) % mod * i % mod;
    ans %= mod;
  }
  printf("%I64d\n", ans);
  return 0;
}
