#include <bits/stdc++.h>
using namespace std;
const int md = 998244353;
int add(int a, int b) {
  a += b;
  if (a >= md) a -= md;
  return a;
}
int sub(int a, int b) {
  a -= b;
  if (a < 0) a += md;
  return a;
}
int mul(int a, int b) { return (int)((long long)a * b % md); }
int power(int a, long long b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) {
      res = mul(res, a);
    }
    a = mul(a, a);
    b >>= 1;
  }
  return res;
}
inline int inv(int a) {
  a %= md;
  if (a < 0) a += md;
  int b = md, u = 0, v = 1;
  while (a) {
    int t = b / a;
    b -= t * a;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  assert(b == 1);
  if (u < 0) u += md;
  return u;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed;
  cout.precision(0);
  int t;
  cin >> t;
  long long sum = 1;
  map<int, int> m;
  m[0] = 1;
  for (int d = 1; d <= t; d++) {
    sum = mul(sum, d);
    m[d] = sum;
  }
  long long sum2 = 0;
  for (int j = 1; j <= t - 2; j++) {
    long long mult;
    mult = mul(m[t], inv(m[j + 1]));
    sum2 = add(sum2, mult);
  }
  if (t == 1)
    cout << 1;
  else
    cout << sub(mul(sum, (t - 1)), sum2);
  return 0;
}
