#include <bits/stdc++.h>
using namespace std;
const int64_t mod = 1e9 + 7;
const int64_t primm = 998244353;
long long n, fact[1000008], sum, art, tor, fak[1000008];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  fact[0] = 1;
  for (long long i = (long long)1; i < (long long)n + 1; i++)
    fact[i] = ((fact[i - 1] * i) % primm);
  fak[0] = 1;
  for (long long i = (long long)1; i < (long long)n; i++) {
    fak[i] = fak[i - 1] * (n + 1 - i);
    fak[i] %= primm;
  }
  for (long long i = (long long)1; i < (long long)n; i++) {
    art = fact[n] - fak[i];
    sum += art;
    sum %= primm;
  }
  sum += fact[n];
  sum %= primm;
  if (sum < 0) sum += primm;
  cout << sum << endl;
  return 0;
}
