MOD = 998244353 n = int(input()) ans = 0 # はにゃ? # n * (n - 1) ...? print(n * (n - 1) % MOD)