#include <bits/stdc++.h>
const int N = 2e5 + 5;
const long double Pi = 3.141592653;
const long long mod = 1e9 + 7;
const long long Mod = 998244353;
const long long Inf = 4e18;
using namespace std;
int dx[9] = {1, -1, 0, 0, 1, 1, -1, -1, 0};
int dy[9] = {0, 0, 1, -1, 1, -1, 1, -1, 0};
long long Binexp(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b % 2) res = (res * a) % Mod;
    a = (a * a) % Mod;
    b = b / 2;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    long long n, ans = 0;
    cin >> n;
    vector<long long> fact(n + 1, 1), inv(n + 1, 1);
    for (int i = 1; i <= n; i++) fact[i] = (fact[i - 1] * i) % Mod;
    for (int i = 0; i <= n; i++) inv[i] = Binexp(fact[i], Mod - 2);
    for (int i = 0; i < n - 1; i++) {
      long long p = (fact[n - 1] * inv[n - 1 - i]) % Mod;
      p = (p * (fact[n - 1 - i] - 1 + Mod) % Mod) % Mod;
      ans = (ans + p) % Mod;
    }
    ans = (ans + fact[n - 1]) % Mod;
    ans = (ans * n) % Mod;
    cout << ans;
  }
  return 0;
}
