n = int(input()) mod = 998244353 f = [0] * (3 * 10 ** 5) f[0] = 1 for i in range(1, 3 * 10 ** 5): f[i] = f[i - 1] * i f[i] %= mod for k in range(1, n + 1): ans = (n - k + 1) * (n * f[n] - f[n - k] * f[n] * (n - k) * pow((k + 1) * f[n - k], mod - 2, mod)) ans %= mod print(ans)