#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
int main() {
  int n;
  cin >> n;
  long long factorials[n + 1];
  factorials[0] = 1;
  for (int i = 1; i <= n; ++i) {
    factorials[i] = (factorials[i - 1] * i) % MOD;
  }
  long long reversefactorials[n + 1];
  reversefactorials[n] = 1;
  for (int i = n - 1; i >= 0; --i) {
    reversefactorials[i] = (reversefactorials[i + 1] * (i + 1)) % MOD;
  }
  long long total = 0;
  for (int i = 2; i < n; ++i) {
    long long numleft = i;
    long long numright = n - i;
    long long ways = 1;
    total += (reversefactorials[numleft] * (factorials[numleft] - 1)) % MOD;
    total %= MOD;
  }
  total += factorials[n];
  cout << (total % MOD) << endl;
}
