#include <bits/stdc++.h>
using namespace std;
long long A1, A2, B1, B2, C1, C2, n, m, b, c, x, e, h, res1, a1, a2, w, a3, y,
    z, a4, a5, a6, a7, a8, a9, a10, last, LL, timer, start, finish, flag, step,
    tests, kilk, bnum;
string s, s1;
long long t;
long long res;
long double l, r;
pair<long long, long long> mas[1007], mas1[1007];
set<long long> answer;
int main() {
  cin >> n;
  res = 1;
  for (int i = 1; i <= n; i++) {
    res *= i;
    res %= 998244353;
  }
  res1 += res;
  a1 = 1;
  for (int i = n; i >= 1; i--) {
    a1 *= i;
    a1 %= 998244353;
    res1 += (res + 998244353 - a1) % 998244353;
    res1 %= 998244353;
  }
  cout << res1 << endl;
}
