#include <bits/stdc++.h>
using int64 = long long;
using uchar = unsigned char;
constexpr int maxn(1000000);
constexpr int p(998244353);
template <class _Tp>
inline int fpow(_Tp v, int n) {
  int pw = 1;
  for (; n; n >>= 1, v = (int64)v * v % p)
    if (n & 1) pw = (int64)pw * v % p;
  return pw;
}
template <class x_tp, class y_tp>
inline void inc(x_tp& x, const y_tp& y) {
  (p - y <= x) ? (x += y - p) : (x += y);
}
template <class x_tp, class y_tp>
inline void dec(x_tp& x, const y_tp& y) {
  x -= y;
  (x < 0) && (x += p);
}
template <class x_tp, class y_tp>
inline x_tp pls(const x_tp& x, const y_tp& y) {
  return (x < p - y) ? (x + y) : (x - p + y);
}
template <class x_tp, class y_tp>
inline x_tp sub(const x_tp& x, const y_tp& y) {
  return (x < y) ? (x - y + p) : (x - y);
}
template <class _Tp>
inline int md(const _Tp& v) {
  return v < 0 ? (p + v < 0 ? (v + 10ll * p) % p : (v + p))
               : (v < p ? v : (v % p));
}
namespace IOManager {
constexpr int FILESZ(131072);
char buf[FILESZ];
const char *ibuf = buf, *tbuf = buf;
struct IOManager {
  inline char gc() {
    return (ibuf == tbuf) &&
                   (tbuf = (ibuf = buf) + fread(buf, 1, FILESZ, stdin),
                    ibuf == tbuf)
               ? EOF
               : *ibuf++;
  }
  template <class _Tp>
  inline operator _Tp() {
    _Tp s = 0u;
    char c = gc(), w = 0;
    for (; c < 48; c = gc()) c == 45 && (w = 1);
    for (; c > 47; c = gc()) s = (_Tp)(s * 10u + c - 48u);
    return w ? -s : s;
  }
};
}  // namespace IOManager
IOManager::IOManager io;
int Fac[maxn + 1], invFac[maxn + 1];
inline int C(const int& n, const int& k) {
  return (int64)Fac[n] * invFac[k] % p * invFac[n - k] % p;
}
int main() {
  const int n = io;
  invFac[0] = invFac[1] = Fac[0] = Fac[1] = 1;
  int v = 1;
  for (int i = 2; i <= n; ++i) v = (int64)v * i % p, Fac[i] = v;
  v = fpow(v, p - 2);
  for (int i = n; i != 1; --i) invFac[i] = v, v = (int64)v * i % p;
  int ans = Fac[n];
  for (int suf = 1; suf != n; ++suf)
    inc(ans, (int64)(Fac[suf] - 1) * Fac[n - suf] % p * C(n, suf) % p);
  printf("%d", ans);
  return 0;
}
