#include <bits/stdc++.h>
using namespace std;
const long double Pi = 3.14159265359;
const long long MOD = 998244353;
const long long MAXN = 2e5 + 10;
const long long INF = 1e18;
long long ans, n, nf, NOW;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  nf = 1;
  for (int i = 1; i <= n; i++) nf = (nf * i) % MOD;
  ans = nf;
  NOW = 1;
  for (int i = n; i >= 1; i--) {
    NOW = (NOW * i) % MOD;
    ans = ((ans + nf - NOW) + MOD) % MOD;
  }
  cout << (ans + MOD) % MOD;
  return 0;
}
