#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int add(int a, int b)
{
return a + b < mod ? a + b : a + b - mod;
}
int mult(int a, int b)
{
return (long long) a * b % mod;
}
int binpow(int a, int n)
{
int res = 1;
while(n)
{
if(n & 1)
res = mult(res, a);
a = mult(a, a);
n /= 2;
}
return res;
}
int main()
{
int n;
cin >> n;
vector<int> fact(n + 1);
fact[0] = 1;
for(int i = 1; i <= n; i++)
fact[i] = mult(fact[i - 1], i);
vector<int> ifact(n + 1);
for(int i = 0; i <= n; i++)
ifact[i] = binpow(fact[i], mod - 2);
int ans = 0;
for(int i = 1; i <= n; i++)
{
int C = mult(fact[n], mult(ifact[n - i], ifact[i]));
ans = add(ans, mult(mult(C, fact[i - 1]), fact[n - i]));
}
cout << ans << "\n";
return 0;
}