#include <bits/stdc++.h>
using namespace std;
int l[50];
const int MOD = 998244353;
void solve() {
  int n;
  cin >> n;
  long long ret = 0;
  long long f = 1;
  for (int i = 2; i <= n; i++) {
    f *= i;
    f %= MOD;
  }
  ret += f;
  long long s = 1;
  for (int i = n; i > 2; i--) {
    s *= i;
    s %= MOD;
    ret += f - s;
    ret %= MOD;
    ret += MOD;
    ret %= MOD;
  }
  cout << ret << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cerr.tie(NULL);
  solve();
}
