#include using i64 = long long; template T qmi(T a, i64 b) { T res = 1; for (; b; b /= 2, a *= a) { if (b % 2) { res *= a; } } return res; } i64 mul(i64 a, i64 b, i64 p) { i64 res = a * b - i64(1.L * a * b / p) * p; res %= p; if (res < 0) { res += p; } return res; } template struct modint { int x; constexpr modint() : x{} {} constexpr modint(i64 x) : x{norm(x % getmod())} {} static int mod; constexpr static int getmod() { if (P > 0) { return P; } else { return mod; } } constexpr static void setmod(int m) { mod = m; } constexpr int norm(int x) const { if (x < 0) { x += getmod(); } if (x >= getmod()) { x -= getmod(); } return x; } constexpr int val() const { return x; } explicit constexpr operator int() const { return x; } constexpr modint operator-() const { modint res; res.x = norm(getmod() - x); return res; } constexpr modint inv() const { assert(x != 0); return qmi(*this, getmod() - 2); } constexpr modint &operator*= (modint v) & { x = 1LL * x * v.x % getmod(); return *this; } constexpr modint &operator+= (modint v) & { x = norm(x + v.x); return *this; } constexpr modint &operator-= (modint v) & { x = norm(x - v.x); return *this; } constexpr modint &operator/= (modint v) & { return *this *= v.inv(); } friend constexpr modint operator- (modint a, modint b) { modint res = a; res -= b; return res; } friend constexpr modint operator+ (modint a, modint b) { modint res = a; res += b; return res; } friend constexpr modint operator* (modint a, modint b) { modint res = a; res *= b; return res; } friend constexpr modint operator/ (modint a, modint b) { modint res = a; res /= b; return res; } friend constexpr std::istream &operator>> (std::istream& is, modint& a) { i64 v; is >> v; a = modint(v); return is; } friend constexpr std::ostream &operator<< (std::ostream& os, const modint& a) { return os << a.val(); } friend constexpr bool operator== (modint a, modint b) { return a.val() == b.val(); } friend constexpr bool operator!= (modint a, modint b) { return a.val() != b.val(); } }; constexpr int P = 998244353; using mint = modint

; struct Comb { int n; std::vector fact; std::vector invefact; std::vector inve; Comb() : n{0}, fact{1}, invefact{1}, inve{0} {} Comb(int n) : Comb() { init(n); } void init(int m) { if (m <= n) return; fact.resize(m + 1); invefact.resize(m + 1); inve.resize(m + 1); for (int i = n + 1; i <= m; i++) { fact[i] = fact[i - 1] * i; } invefact[m] = fact[m].inv(); for (int i = m; i > n; i--) { invefact[i - 1] = invefact[i] * i; inve[i] = invefact[i] * fact[i - 1]; } n = m; } mint fac(int m) { if (m > n) init(2 * m); return fact[m]; } mint invfac(int m) { if (m > n) init(2 * m); return invefact[m]; } mint inv(int m) { if (m > n) init(2 * m); return inve[m]; } mint binom(int n, int m) { if (n < m || m < 0) return 0; return fac(n) * invfac(m) * invfac(n - m); } } comb; int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int n; std::cin >> n; mint ans = 0; for (int a = 2; a < n - 1; a++) { int b = n - a; mint c = comb.fac(n) * comb.invfac(a - 2) * comb.invfac(b - 2) / a / b / (n - 1); ans += c * c; } std::cout << ans << "\n"; return 0; }