#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int n;
long long ans, now;
template <class T>
inline void read(T &x) {
  x = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  return;
}
int main() {
  cin >> n;
  ans = n, now = 1;
  for (register int i = 1; i <= n; ++i) ans = ans * i % mod;
  for (register int i = n; i >= 2; --i)
    now = now * i % mod, ans = (ans - now + mod) % mod;
  cout << ans;
  return 0;
}
