#include <bits/stdc++.h>
using namespace std;
int a, b, c, n, m, T, x[1000], mod = 998244353;
int main() {
  scanf("%d", &n);
  long long ans = 1, ss = 1;
  for (int i = 1; i <= n; i++) {
    ans = (ans + ss - 1) % mod;
    ans = (ans * i) % mod;
    ss = (ss * i) % mod;
  }
  cout << ans << endl;
}
