import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

enum mod = 998244353L;

void main() {
    int n;
    scan(n);

    auto f = new long[](n + 1);
    f[0] = f[1] = 1;
    foreach (i ; 2 .. n + 1) {
        f[i] = f[i-1] * i % mod;
    }
    auto rf = new long[](n + 1);
    rf[n] = powmod(f[n], mod - 2, mod);
    foreach_reverse (i ; 1 .. n) {
        rf[i] = rf[i+1] * (i + 1) % mod;
    }

    long comb(int n, int k) {
        return f[n] * rf[k] % mod * rf[n-k] % mod;
    }

    long ans = f[n];

    foreach (i ; 2 .. n) {
        long t = comb(n, i) * (f[i] - 1 + mod) % mod * f[n - i] % mod;
        ans += t;
        ans %= mod;
    }

    writeln(ans);
}

long powmod(long x, long y, long mod) {
    return y > 0 ? powmod(x, y>>1, mod)^^2 % mod * x^^(y&1) % mod : 1;
}




void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}


void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}