#include <bits/stdc++.h>
using namespace std;
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, 1, 0, -1};
const int dl[] = {0, 0, 0, -1};
const int dr[] = {0, 0, -1, 0};
long long Inverse(long long a, long long MOD) {
  long long m = a, n = MOD;
  long long xm = 1, xn = 0;
  while (n != 0) {
    long long q = m / n;
    long long r = m - q * n;
    long long xr = xm - q * xn;
    m = n;
    xm = xn;
    n = r;
    xn = xr;
  }
  return (xm % MOD + MOD) % MOD;
}
int lg(long long x) {
  int res = 0;
  for (int i = 0; i < x; i++) {
    long long GT = (1ll << i);
    if (GT <= x) {
      res = i;
    } else {
      return res;
    }
  }
  return res;
}
long long GCD(long long a, long long b) {
  if (b == 0) {
    return abs(a);
  }
  return GCD(b, a % b);
}
long long sqr(long long x) { return x * x; }
long long nhan(long long a, long long b, long long module) {
  a %= module;
  b %= module;
  long long q = (long double)a * b / module;
  long long r = (a * b - q * module) % module;
  if (r < 0) {
    r += module;
  }
  return r;
}
long long MU(long long a, long long n, long long module) {
  long long res = 1;
  for (; n; n = n >> 1, a = nhan(a, a, module)) {
    if (n & 1) {
      res = nhan(res, a, module);
    }
  }
  return res;
}
void hamZ(string S, int z[]) {
  int n = S.size();
  for (int i = 0; i <= n; i++) {
    z[i] = 0;
  }
  int L = 1, R = 1;
  for (int i = 2; i <= n; i++) {
    if (i <= R) {
      z[i] = min(z[i - L + 1], R - i + 1);
    }
    while (i + z[i] <= n && S[z[i]] == S[i + z[i] - 1]) {
      z[i]++;
    }
    if (i + z[i] - 1 > R) {
      R = i + z[i] - 1;
      L = i;
    }
  }
}
void Sang(int N, vector<int> Uoc[]) {
  for (int i = 1; i <= N; i++) {
    for (int j = i; j <= N; j += i) Uoc[j].push_back(i);
  }
}
struct Point {
  int x, y;
  Point(){};
  Point(int a, int b) {
    x = a;
    y = b;
  }
};
void Tru(Point &A, Point B) {
  A.x -= B.x;
  A.y -= B.y;
}
bool CungChieu(Point O, Point A, Point B) {
  Tru(A, O);
  Tru(B, O);
  return 1ll * A.x * B.y < 1ll * A.y * B.x;
}
bool ThangHang(Point O, Point A, Point B) {
  Tru(A, O);
  Tru(B, O);
  return 1ll * A.x * B.y == 1ll * A.y * B.x;
}
bool NguocChieu(Point O, Point A, Point B) {
  Tru(A, O);
  Tru(B, O);
  return 1ll * A.x * B.y > 1ll * A.y * B.x;
}
const int N = 1e6 + 10;
const double sodu = 1e-9;
const long long oo = 1e18;
const int module = 998244353;
const int M = 1e9 + 7;
const int NN = (1 << 16);
long long IT[N * 4], lazy[N * 4];
int n;
void nhap() { cin >> n; }
void cn(int i, int l, int r) {
  if (lazy[i] == 1) return;
  IT[i] = IT[i] * lazy[i] % module;
  if (l != r) {
    lazy[i << 1] = lazy[i << 1] * lazy[i] % module;
    lazy[i << 1 | 1] = lazy[i << 1 | 1] * lazy[i] % module;
  }
  lazy[i] = 1;
}
void cn(int i, int l, int r, int u, int v, int val) {
  cn(i, l, r);
  if (l > v || r < u) return;
  if (l >= u && r <= v) {
    lazy[i] = lazy[i] * val % module;
    cn(i, l, r);
    return;
  }
  int mid = (l + r) >> 1;
  cn(i << 1, l, mid, u, v, val);
  cn(i << 1 | 1, mid + 1, r, u, v, val);
  IT[i] = (IT[i << 1] + IT[i << 1 | 1]) % module;
}
int Get(int i, int l, int r, int u, int v) {
  cn(i, l, r);
  if (l > v || r < u) return 0;
  if (l >= u && r <= v) return IT[i];
  int mid = (l + r) >> 1;
  int left = Get(i << 1, l, mid, u, v);
  int right = Get(i << 1 | 1, mid + 1, r, u, v);
  return (left + right) % module;
}
void solve() {
  for (int i = 1; i < 4 * n; i++) {
    lazy[i] = 1;
    IT[i] = 1;
  }
  if (n <= 2) {
    cout << n;
    return;
  }
  for (int i = 3; i < n; i++) {
    cn(1, 1, n, 1, i - 2, i);
    cn(1, 1, n, i - 1, i - 1, i - 1);
  }
  long long Res = 0;
  for (int i = 1; i <= n - 2; i++) {
    int Value = Get(1, 1, n, i, i);
    Res += 1ll * Value * (n - 1 - i) % module;
    Res %= module;
  }
  long long GT = 1;
  for (int i = 1; i <= n; i++) GT = GT * i % module;
  cout << (Res * n + GT) % module;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  nhap();
  solve();
}
