#include <bits/stdc++.h>
class modint_t;
modint_t modpow(modint_t x, long long y);
class modint_t {
  friend std::ostream& operator<<(std::ostream& ofs, const modint_t a);

 public:
  modint_t(long long xx = 0) : x(xx % 998244353){};

 public:
  long long get() {
    normalize();
    return x;
  };

 public:
  bool operator==(modint_t a) const { return x == a.x; };
  bool operator!=(modint_t a) const { return !(*this == a); };

 public:
  modint_t operator+(const modint_t& a) const { return (x + a.x) % 998244353; };
  modint_t operator-(const modint_t& a) const { return (x - a.x) % 998244353; };
  modint_t operator*(const modint_t& a) const { return x * a.x % 998244353; };
  modint_t operator/(const modint_t& a) const {
    return (*this) * a.inversed();
  };
  modint_t operator^(long long i) const { return modpow(x, i); };

 public:
  modint_t& operator+=(const modint_t& a) {
    (x += a.x) %= 998244353;
    return *this;
  };
  modint_t& operator-=(const modint_t& a) {
    (x -= a.x) %= 998244353;
    return *this;
  };
  modint_t& operator*=(const modint_t& a) {
    (x *= a.x) %= 998244353;
    return *this;
  };
  modint_t& operator/=(const modint_t& a) {
    (x *= a.inversed().x) %= 998244353;
    return *this;
  };

 public:
  modint_t inversed() const {
    assert(x % 998244353);
    return modpow(x, 998244353 - 2);
  };
  void inverse() {
    assert(x % 998244353);
    x = modpow(x, 998244353 - 2).x;
  };

 private:
  void normalize() {
    while (!(0 <= x && x < 998244353)) x = (x + 998244353) % 998244353;
  };

 private:
  long long x;
};
modint_t operator+(long long a, const modint_t& b) { return modint_t(a) + b; }
modint_t operator-(long long a, const modint_t& b) { return modint_t(a) - b; }
modint_t operator*(long long a, const modint_t& b) { return modint_t(a) * b; }
modint_t operator/(long long a, const modint_t& b) { return modint_t(a) / b; }
std::ostream& operator<<(std::ostream& ofs, modint_t a) {
  a.normalize();
  ofs << a.x;
  return ofs;
}
modint_t modpow(modint_t x, long long y) {
  modint_t xx = x, p = 1;
  for (; y; xx *= xx, y >>= 1)
    if (y & 1) p *= xx;
  return p;
}
modint_t modncr(int n, int r) {
  assert(n >= 0);
  assert(r >= 0);
  if (n == 0) return r == 0 ? 1 : 0;
  if (r > n) return 0;
  modint_t num = 1, denom = 1;
  int dm = std::min(r, n - r);
  int dp = std::max(r, n - r);
  for (int i = dp + 1; i <= n; i++) num *= i;
  for (int i = 2; i <= dm; i++) denom *= i;
  return modpow(denom, 998244353 - 2) * num;
}
modint_t f[1111111];
int main(int argc, char** argv) {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);
  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);
  long long n;
  std::cin >> n;
  modint_t x = 1;
  for (int i = 0; i < 1111111; i++, x *= i) f[i] = x;
  modint_t s = f[n];
  x = n;
  for (int i = 1; i < n - 1; x *= (n - i), i++) s += f[n] - x;
  std::cout << s << std::endl;
  return 0;
}
