#include <bits/stdc++.h>
using namespace std;
int M = 998244353;
long long int fac[1000005];
int pow_mod(long long int num, int pow) {
  if (pow == 0) return 1;
  if (pow == 1) return num;
  long long int temp = pow_mod(num, pow >> 1);
  temp = (temp * temp) % M;
  if (pow & 1) temp = (temp * num) % M;
  return temp;
}
int mod_inverse(int n) { return pow_mod(n, M - 2); }
int main() {
  fac[0] = fac[1] = 1;
  for (int i = 2; i < 1000005; ++i) fac[i] = (fac[i - 1] * i) % M;
  int n;
  cin >> n;
  long long int ans = 0;
  for (int i = 2; i < n; ++i) {
    ans = (ans + (fac[i] - 1 + M) % M * mod_inverse(fac[i]) % M) % M;
  }
  cout << fac[n] * (1 + ans) % M;
  return 0;
}
