mod = 998244353 n = int(input()) print(n*(n-1)%mod)