""" https://yukicoder.me/problems/no/3042 ((())) -> 3 ()(()) -> 1 (())() -> 1 (()()) -> 2 """ N = int(input()) mod = 998244353 f = [0] * (N+1) f[0] = 1 g = [0] * (N+1) for i in range(N): nf = [0] * (N+1) ng = [0] * (N+1) for j in range(N+1): if j != 0: nf[j-1] += f[j] ng[j-1] += g[j] + f[j] * (j-1) nf[j-1] %= mod ng[j-1] %= mod if j != N: nf[j+1] += f[j] ng[j+1] += g[j] nf[j+1] %= mod ng[j+1] %= mod f,g = nf,ng # print (f,g) print (g[0])