#include #include using namespace std; using namespace atcoder; #define sz(x) ((int64_t)x.size()) #define all(v) (v).begin(),(v).end() #define rall(v) (v).rbegin(),(v).rend() #define in_grid(h, w, H, W) if (!(0 <= h && 0 <= w && h < H && w < W)) continue; template using priority_queue_g = priority_queue, greater>; template using vec = vector; //組み合わせ template< typename T > struct Combination { vector< T > _fact, _rfact, _inv; Combination(int sz) : _fact(sz + 1), _rfact(sz + 1), _inv(sz + 1) { _fact[0] = _rfact[sz] = _inv[0] = 1; for(int i = 1; i <= sz; i++) _fact[i] = _fact[i - 1] * i; _rfact[sz] /= _fact[sz]; for(int i = sz - 1; i >= 0; i--) _rfact[i] = _rfact[i + 1] * (i + 1); for(int i = 1; i <= sz; i++) _inv[i] = _rfact[i] * _fact[i - 1]; } inline T fact(int k) const { return _fact[k]; } inline T rfact(int k) const { return _rfact[k]; } inline T inv(int k) const { return _inv[k]; } T P(int n, int r) const { if(r < 0 || n < r) return 0; return fact(n) * rfact(n - r); } T C(int p, int q) const { if(q < 0 || p < q) return 0; return fact(p) * rfact(q) * rfact(p - q); } T H(int n, int r) const { if(n < 0 || r < 0) return (0); return r == 0 ? 1 : C(n + r - 1, r); } }; template int64_t LIS (const vector& V) { vector DP(V.size()); int len = 0; for (const auto& x : V) { auto itr = lower_bound(DP.begin(), DP.begin() + len, x); *itr = x; if (itr == DP.begin() + len) len++; } return len; } int64_t powmod(int64_t a, int64_t b, int64_t mod) { a %= mod; int64_t res = 1 % mod; while (b) { if (b&1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; } template bool chtop(vector& a, const T& b, int limit_size = -1) { if (limit_size == -1) limit_size = a.size(); if ((int)a.size() < limit_size) { auto it = lower_bound(a.begin(), a.end(), b, greater()); a.insert(it, b); return true; } if (limit_size == 0 || b <= a.back()) return false; a.pop_back(); auto it = lower_bound(a.begin(), a.end(), b, greater()); a.insert(it, b); return true; } template bool chbot(vector& a, const T& b, int limit_size = -1) { if (limit_size == -1) limit_size = a.size(); if ((int)a.size() < limit_size) { auto it = lower_bound(a.begin(), a.end(), b); a.insert(it, b); return true; } if (limit_size == 0 || b >= a.back()) return false; a.pop_back(); auto it = lower_bound(a.begin(), a.end(), b); a.insert(it, b); return true; } //ループマクロ #define re(n) for (int64_t r_= 0; r_< int64_t(n);r_++) #define rep(i, n) for (int64_t i = 0; i < int64_t(n); i++) #define repp(i, n) for (int64_t i = 0; i <= int64_t(n); i++) #define rrep(i, a, b) for (int64_t i = int64_t(a); i < int64_t(b); i++) #define rrepp(i, a, b) for (int64_t i = int64_t(a); i <= int64_t(b); i++) #define reep(i, n) for (int64_t i = int64_t(n)-1; i >= 0; i--) #define reepp(i, n) for (int64_t i = int64_t(n); i >= 0; i--) #define rreep(i, a, b) for (int64_t i = int64_t(b)-1; i >= int64_t(a); i--) #define rreepp(i, a, b) for (int64_t i = int64_t(b); i >= int64_t(a); i--) template bool chmax(T& a, const U&b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T& a, const U&b) { if (a > b) { a = b; return true; } return false; } using lint = int64_t; using pll = pair; using vl = vector; using vvl = vector>; using vvvl = vector>>; using vpll = vector>; using ld = long double; using mint = modint998244353; void yn(bool b) { cout << (b ? "Yes" : "No") << endl; } const lint MOD = 998244353; // const lint MOD = 1000000007; const lint INF = 4004004004004004004; const ld pi = 3.141592653589793238; const lint dx[] = {-1,0,1,0,-1,1,1,-1}; const lint dy[] = {0,-1,0,1,-1,-1,1,1}; void solve() { lint n; cin >> n; cout << (n * (n-1)) % MOD << "\n"; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(20); int T = 1; // cin >> T; while (T--) solve(); }