MOD = 998244353 N = int(input()) print(N * (N-1) % MOD)