#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long mod = 998244353;
long long fac[1000006];
long long ifac[1000006];
long long add(long long x, long long y) { return (x + y) % mod; }
long long mul(long long x, long long y) { return (x * y) % mod; }
long long ncr(long long x, long long y) {
  if (x < y) return 0;
  long long tmp = mul(fac[x], ifac[y]);
  tmp = mul(tmp, ifac[x - y]);
  return tmp;
}
long long mod_pow(long long x, int p) {
  if (p == 0) return 1;
  if (p == 1) return x;
  long long tmp = mod_pow(x, p / 2);
  tmp = mul(tmp, tmp);
  if (p & 1) {
    tmp = mul(tmp, x);
  }
  return tmp;
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  int n;
  cin >> n;
  fac[0] = 1;
  ifac[0] = 1;
  for (int i = 1; i < (n + 1); ++i) {
    fac[i] = mul(fac[i - 1], i);
  }
  ifac[n] = mod_pow(fac[n], mod - 2);
  for (int i = n - 1; i >= 1; i--) {
    ifac[i] = mul(ifac[i + 1], i + 1);
  }
  long long ans = fac[n];
  for (int len = 1; len < n - 1; len++) {
    long long tmp = mul(ncr(n, len), fac[len]);
    tmp = mul(tmp, n - len - 1);
    tmp = mul(tmp, len);
    ans = add(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
