n=int(input())-1 M=998244353 def seki(a,b): c=[[0]*2,[0]*2] for i in range(2): for j in range(2): for k in range(2): c[i][j]+=a[i][k]*b[k][j] c[i][j]%=M return c A=[[1,1],[1,0]] B=[[1,0],[0,1]] for i in range(60): if (n>>i)&1: B=seki(A,B) A=seki(A,A) print((B[0][0]+B[1][0]-1)%M)