#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int main() {
  int n;
  cin >> n;
  long long ans = 1;
  for (int i = 1; i <= n; i++) ans = ans * i % mod;
  ans = ans * n % mod;
  long long tmp = 1;
  for (int i = n; i >= 2; i--) {
    tmp = tmp * i % mod;
    ans = (ans - tmp + mod) % mod;
  }
  cout << ans << endl;
}
