def mul(A,B):
    C=[[0]*len(B) for i in range(len(A[0]))]
    for i in range(len(A)):
        for j in range(len(B[0])):
            for k in range(len(B)):
                C[i][j]=(C[i][j]+A[i][k]*B[k][j])
    return C

def matpow(vec,n):
    B=[[0]*len(vec) for i in range(len(vec))]
    for i in range(len(vec)):
        B[i][i]=1
    while(n>0):
        if n&1:
            B=mul(B,vec)
        vec=mul(vec,vec)
        n>>=1
    return B

N=int(input())
vec=[[1,1],[1,0]]

vec=matpow(vec,N+1)
print(vec[1][0]) def mul(A,B):
    C=[[0]*len(B) for i in range(len(A[0]))]
    for i in range(len(A)):
        for j in range(len(B[0])):
            for k in range(len(B)):
                C[i][j]=(C[i][j]+A[i][k]*B[k][j])
    return C mul [0]*len(B) for i in range(len(A[0])) for i in range(len(A[0])) i range(len(A[0])) range len(A[0]) len A[0] A 0 for i in range(len(A[0])) [0]*len(B) [0] 0 len(B) len B C=[[0]*len(B) for i in range(len(A[0]))] C [[0]*len(B) for i in range(len(A[0]))] for i in range(len(A)):
        for j in range(len(B[0])):
            for k in range(len(B)):
                C[i][j]=(C[i][j]+A[i][k]*B[k][j])
     i range(len(A)) range len(A) len A for j in range(len(B[0])):
            for k in range(len(B)):
                C[i][j]=(C[i][j]+A[i][k]*B[k][j])
     j range(len(B[0])) range len(B[0]) len B[0] B 0 for k in range(len(B)):
                C[i][j]=(C[i][j]+A[i][k]*B[k][j])
     k range(len(B)) range len(B) len B C[i][j]=(C[i][j]+A[i][k]*B[k][j]) C[i][j] [i] C i j C[i][j]+A[i][k]*B[k][j] C[i][j] [i] C i j A[i][k]*B[k][j] A[i][k] [i] A i k B[k][j] [k] B k j return C C A A B B def matpow(vec,n):
    B=[[0]*len(vec) for i in range(len(vec))]
    for i in range(len(vec)):
        B[i][i]=1
    while(n>0):
        if n&1:
            B=mul(B,vec)
        vec=mul(vec,vec)
        n>>=1
    return B matpow [0]*len(vec) for i in range(len(vec)) for i in range(len(vec)) i range(len(vec)) range len(vec) len vec for i in range(len(vec)) [0]*len(vec) [0] 0 len(vec) len vec B=[[0]*len(vec) for i in range(len(vec))] B [[0]*len(vec) for i in range(len(vec))] for i in range(len(vec)):
        B[i][i]=1
     i range(len(vec)) range len(vec) len vec B[i][i]=1 B[i][i] [i] B i i 1 while(n>0):
        if n&1:
            B=mul(B,vec)
        vec=mul(vec,vec)
        n>>=1
     n>0 n 0 if n&1:
            B=mul(B,vec)
         n&1 n 1 B=mul(B,vec) B mul(B,vec) mul B vec vec=mul(vec,vec) vec mul(vec,vec) mul vec vec n>>=1 n 1 return B B vec vec n n N=int(input()) N int(input()) int input() input vec=[[1,1],[1,0]] vec [[1,1],[1,0]] [1,1] 1 1 [1,0] 1 0 vec=matpow(vec,N+1) vec matpow(vec,N+1) matpow vec N+1 N 1 print(vec[1][0]) print vec[1][0] [1] vec 1 0 vec=[[1,1],[1,0]] [[1,1],[1,0]] vec def mul(A,B):
    C=[[0]*len(B) for i in range(len(A[0]))]
    for i in range(len(A)):
        for j in range(len(B[0])):
            for k in range(len(B)):
                C[i][j]=(C[i][j]+A[i][k]*B[k][j])
    return C def mul(A,B):
    C=[[0]*len(B) for i in range(len(A[0]))]
    for i in range(len(A)):
        for j in range(len(B[0])):
            for k in range(len(B)):
                C[i][j]=(C[i][j]+A[i][k]*B[k][j])
    return C mul def matpow(vec,n):
    B=[[0]*len(vec) for i in range(len(vec))]
    for i in range(len(vec)):
        B[i][i]=1
    while(n>0):
        if n&1:
            B=mul(B,vec)
        vec=mul(vec,vec)
        n>>=1
    return B def matpow(vec,n):
    B=[[0]*len(vec) for i in range(len(vec))]
    for i in range(len(vec)):
        B[i][i]=1
    while(n>0):
        if n&1:
            B=mul(B,vec)
        vec=mul(vec,vec)
        n>>=1
    return B matpow N=int(input()) int(input()) N vec=matpow(vec,N+1) matpow(vec,N+1) vec
def mul(A,B):
    C=[[0]*len(B) for i in range(len(A[0]))]
    for i in range(len(A)):
        for j in range(len(B[0])):
            for k in range(len(B)):
                C[i][j]=(C[i][j]+A[i][k]*B[k][j])
    return C

def matpow(vec,n):
    B=[[0]*len(vec) for i in range(len(vec))]
    for i in range(len(vec)):
        B[i][i]=1
    while(n>0):
        if n&1:
            B=mul(B,vec)
        vec=mul(vec,vec)
        n>>=1
    return B

N=int(input())
vec=[[1,1],[1,0]]

vec=matpow(vec,N+1)
print(vec[1][0])
