n=2 MOD=998244353 def product(a,b): c=[[0 for _ in range(n)]for _ in range(n)] for i in range(n): for j in range(n): for k in range(n): c[i][j]=(c[i][j]+a[i][k]*b[k][j])%MOD return c def fibonacci(N): S=str(bin(N))[2:][::-1] M=len(S) L=[[[1,1],[1,0]]] for i in range(M-1): L.append(product(L[i],L[i])) R=[[1,0],[0,1]] for i in range(M): if S[i]=="1": R=product(R,L[i]) return (R[0][1]) x=int(input()) print((fibonacci(x+1)-1)%MOD)