#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
const int maxn = 100000 + 5;
int n;
int main() {
  cin >> n;
  long long x = 1, y = 0;
  for (long long i = n; i > 1; i--) x = x * i % mod, y = (x + y) % mod;
  cout << (n * x % mod - y + mod) % mod;
  return 0;
}
