#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cout << x; }
void __print(long x) { cout << x; }
void __print(long long x) { cout << x; }
void __print(unsigned x) { cout << x; }
void __print(unsigned long x) { cout << x; }
void __print(unsigned long long x) { cout << x; }
void __print(float x) { cout << x; }
void __print(double x) { cout << x; }
void __print(long double x) { cout << x; }
void __print(char x) { cout << '\'' << x << '\''; }
void __print(const char *x) { cout << '\"' << x << '\"'; }
void __print(const string &x) { cout << '\"' << x << '\"'; }
void __print(bool x) { cout << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cout << '{';
  __print(x.first);
  cout << ',';
  __print(x.second);
  cout << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cout << '{';
  for (auto &i : x) cout << (f++ ? "," : ""), __print(i);
  cout << "}";
}
void _print() { cout << "\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cout << ", ";
  _print(v...);
}
long long mod = 998244353;
long long power(long long x, long long y) {
  long long p = mod;
  long long res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res % mod;
}
long long add(long long x, long long y) { return (x % mod + y % mod) % mod; }
long long mul(long long x, long long y) {
  return ((x % mod) * (y % mod)) % mod;
}
int solve() {
  long long n, ans, val = 0;
  cin >> n;
  vector<long long> fact(n + 1);
  fact[1] = 1;
  for (long long i = (2); i < (n + 1); ++i) fact[i] = mul(i, fact[i - 1]);
  ans = n;
  for (long long i = (1); i < (n + 1); ++i) ans = mul(ans, i);
  if (n > 1) val = fact[n];
  for (long long i = (2); i < (n); ++i)
    val = add(val, mul(fact[n], power(fact[i], mod - 2)));
  cout << (mod + ans - val) % mod;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
