#include <bits/stdc++.h>
#pragma GCC optimize("-O2")
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
const int LIM = 2e5 + 5, MOD = 998244353, EPS = 1e-9;
int t, n, m, k, x, y;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  long long int ans = 0;
  long long int term1 = 1;
  for (int i = 0; i < n; i++) {
    term1 *= (long long int)(i + 1);
    term1 %= MOD;
  }
  term1 *= n;
  term1 %= MOD;
  ans += term1;
  ans %= MOD;
  term1 = n;
  for (int i = 0; i < n - 1; i++) {
    ans -= term1;
    term1 *= (long long int)(n - i - 1);
    term1 %= MOD;
    ans %= MOD;
    ans += MOD;
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}
