#include<bits/stdc++.h>
using namespace std;
//#define ONLINE
#ifndef ONLINE
#define debug(...) fprintf(stderr,##__VA_ARGS__)
#else
#define debug(...) ;
#endif
using LL=long long;
using PII=pair<int,int>;
template<typename T>
inline T READ(){
T x=0; bool f=0; char c=getchar();
while(!isdigit(c)) f|=(c=='-'),c=getchar();
while(isdigit(c)) x=x*10+c-'0',c=getchar();
return f?-x:x;
}
inline int read(){return READ<int>();}
inline LL readLL(){return READ<LL>();}
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());
const int mod=998244353;
LL ksm(LL a,LL b){
a%=mod; LL ret=1;
while(b){
if(b&1) ret=ret*a%mod;
a=a*a%mod;
b>>=1;
}
return ret;
}
#define N 10000010
namespace Fac{//factorial
LL fc[N]={1},fc_inv[N]={1};
void init(){
for(int i=1;i<N;i++){
fc[i]=fc[i-1]*i%mod;
fc_inv[i]=fc_inv[i-1]*ksm(i,mod-2)%mod;
}
}
LL F(const int& x){
return fc[x];
}
LL P(const int& x,const int& y){
return fc[x]*fc_inv[x-y]%mod;
}
LL C(const int& x,const int& y){
return fc[x]*fc_inv[y]%mod*fc_inv[x-y]%mod;
}
}
int main(){
Fac::init();
int n=read(); LL ans=0;
for(int i=1;i<=n;i++){
ans=(ans+(Fac::P(n-i,i-1)*Fac::F(n-i)%mod))%mod;
}
printf("%lld",ans);
return 0;
}
/* stuff you should look for
* int overflow, array bounds
* special cases (n=1?)
* do smth instead of nothing and stay organized
* WRITE STUFF DOWN
* DON'T GET STUCK ON ONE APPROACH
*/