import sys input = lambda: sys.stdin.readline().rstrip() MOD = 998244353 def even(P): return P[0::2] def odd(P): return P[1::2] def mul(P, Q): N = len(P); M = len(Q) R = [0]*(N+M-1) for i in range(N): for j in range(M): R[i+j] += P[i]*Q[j] R[i+j] %= MOD return R def negx(Q): return [(-n if i&1 else n) for i, n in enumerate(Q)] def bostan_mori(N, P, Q): while N > 0: Qx = negx(Q) U = mul(P, Qx) if N&1: P = odd(U) else: P = even(U) Q = even(mul(Q, Qx)) N >>= 1 return P[0] * pow(Q[0], MOD-2, MOD) def main(): # 入力 N = int(input()) # 計算・出力 print(bostan_mori(N+1, [0, 1], [1, -1, -1]) - 1) if __name__ == "__main__": main()