n=int(input()) M=998244353 def seki(a,b): c=[[0,0],[0,0]] 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 I=[[1,0],[0,1]] A=[[1,1],[1,0]] W=[seki(A,I)] for i in range(1,61): W+=[seki(W[-1],W[-1])] a=seki(I,I) for i in range(61): if (n>>i)&1: a=seki(W[i],a) print((a[0][1]+a[1][1]-1)%M)