#include <bits/stdc++.h>
using namespace std;
const long long int mod2 = 998244353;
long long int invmod(long long int a, unsigned long long int b,
                     long long int n) {
  long long int x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) x = (x * y) % n;
    y = (y * y) % n;
    b /= 2;
  }
  return (x % n);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n;
  cin >> n;
  long long int fact[n + 1], invfact[n + 1];
  fact[0] = 1;
  invfact[0] = 1;
  for (long long int i = 1; i < n + 1; i++) {
    fact[i] = (fact[i - 1] * (i)) % mod2;
    invfact[i] = (invfact[i - 1] * invmod(i, mod2 - 2, mod2)) % mod2;
  }
  long long int ans = (n * fact[n]) % mod2;
  for (long long int i = 1; i < n + 1; i++)
    ans = (ans - (fact[n] * invfact[i]) % mod2 + mod2) % mod2;
  cout << ans + 1 << '\n';
}
