#include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
namespace mp=boost::multiprecision;

int main(){
    int N;
    cin>>N;
    long long MOD=998244353;
    vector<long long> A(N+1),B(N+1);
    long long ans=1;
    A[0]=1;
    for(int i=4;i<=N;i++){
        if(i%2){
            A[i]=((i-1)*A[i-1]+2*(i-1)*A[i-2])%MOD;
        }else{
            A[i]=((i-1)*A[i-1]+2*(i-2)*A[i-4])%MOD;
        }
    }
    B[0]=1;
    for(int i=1;i<=N;i++){
        B[i]=(i*B[i-1]+(i%2?-1:1))%MOD;
        ans=(ans*i)%MOD;
    }
    ans=(ans-2*B[N]+A[N])%MOD;
    while(ans<0){
        ans+=MOD;
    }
    cout<<ans<<endl;
}