#include <bits/stdc++.h>
using namespace std;
static int M = 998244353;
static int f[1000005], invf[1000005];
int fp(int xx, int k) {
  long long x = xx;
  long long result = 1;
  while (k > 0) {
    if (k & 1) result = result * x % M;
    x = x * x % M;
    k /= 2;
  }
  return (int)result;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  f[0] = 1;
  for (int i = 1; i <= n; ++i) f[i] = 1ll * f[i - 1] * i % M;
  invf[n] = fp(f[n], M - 2);
  for (int i = n - 1; i >= 0; i--) invf[i] = 1ll * invf[i + 1] * (i + 1) % M;
  long long count = 0;
  count += f[n];
  for (int i = 2; i < n; ++i) {
    count += 1ll * (f[i] - 1) * f[n] % M * invf[i] % M;
  }
  count %= M;
  count += M;
  count %= M;
  cout << count;
  return 0;
}
