#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  cin >> n;
  int *A = new int[n + 1]{0};
  int *B = new int[n + 1]{0};
  long long temp = 1LL;
  A[0] = 1;
  for (int i = 1; i < n + 1; i++) {
    temp *= (long long)i;
    temp %= 998244353;
    A[i] += temp;
    long long t = (long long)(A[i - 1] - 1) * i;
    A[i] += t % 998244353;
    A[i] %= 998244353;
  }
  cout << A[n] << endl;
  delete[] A;
  return 0;
}
