#include <bits/stdc++.h>
using namespace std;
unsigned int n, i, f, p, s, rez;
int main() {
  cin >> n;
  f = 1;
  for (i = 1; i <= n; i++) f = ((unsigned long long)f * i) % 998244353;
  f = ((unsigned long long)f * n) % 998244353;
  p = 1;
  s = 0;
  for (i = n; i >= 2; i--) {
    p = ((unsigned long long)p * i) % 998244353;
    s = (s + p) % 998244353;
  }
  rez = (f - s + 998244353) % 998244353;
  cout << rez;
  return 0;
}
