#include <bits/stdc++.h>
using namespace std;
template <class A>
void pr(A a) {
  cout << a;
  cout << '\n';
}
template <class A, class B>
void pr(A a, B b) {
  cout << a << ' ';
  pr(b);
}
template <class A, class B, class C>
void pr(A a, B b, C c) {
  cout << a << ' ';
  pr(b, c);
}
template <class A, class B, class C, class D>
void pr(A a, B b, C c, D d) {
  cout << a << ' ';
  pr(b, c, d);
}
template <class A>
void PR(A a, long long n) {
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    if (i) cout << ' ';
    cout << a[i];
  }
  cout << '\n';
}
long long check(long long n, long long m, long long x, long long y) {
  return x >= 0 && x < n && y >= 0 && y < m;
}
const long long MAX = 998244353, MAXL = 1LL << 61, dx[4] = {-1, 0, 1, 0},
                dy[4] = {0, 1, 0, -1};
void extended_euclid(long long x, long long y, long long *c, long long *a,
                     long long *b) {
  long long a0, a1, a2, b0, b1, b2, r0, r1, r2, q;
  r0 = x;
  r1 = y;
  a0 = 1;
  a1 = 0;
  b0 = 0;
  b1 = 1;
  while (r1 > 0) {
    q = r0 / r1;
    r2 = r0 % r1;
    a2 = a0 - q * a1;
    b2 = b0 - q * b1;
    r0 = r1;
    r1 = r2;
    a0 = a1;
    a1 = a2;
    b0 = b1;
    b1 = b2;
  }
  *c = r0;
  *a = a0;
  *b = b0;
}
long long get_inv(long long n, long long p) {
  long long a, b, c;
  extended_euclid(n, p, &c, &a, &b);
  if (a < p) a += p;
  return a % p;
}
void Main() {
  long long n;
  cin >> n;
  long long s = 1;
  for (long long i = (long long)(1); i < (long long)(n + 1); i++) {
    s *= i;
    s %= MAX;
  }
  long long ans = s, x = n * (n - 1) % MAX;
  for (long long i = (long long)(0); i < (long long)(n - 1); i++) {
    if (i) {
      long long d = x * get_inv(n - i, MAX) % MAX;
      s -= d;
      s += MAX;
      s %= MAX;
    } else {
      long long d = x * get_inv(n - 1, MAX) % MAX;
      s -= d;
      s += MAX;
      s %= MAX;
    }
    ans += s;
    ans %= MAX;
    x *= n - i - 2;
    x %= MAX;
  }
  pr(ans);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  Main();
  return 0;
}
