from functools import lru_cache

 

N = int(eval(input()))

 

@lru_cache(maxsize=None)

def luca(n):

    if n == 0:

        return 2

    if n == 1:

        return 1

 

    return luca(n - 1) + luca(n - 2)

 

print((luca(N)))
n = int(eval(input()))

luca = [0]*(n+1)

luca[0] = 2

luca[1] = 1

for i in range(2, n+1):

    luca[i] = luca[i-1] + luca[i-2]

print((luca[n]))

from functools import lru_cache

N = int(eval(input()))


@lru_cache(maxsize=None)
def luca(n):
    if n == 0:
        return 2
    if n == 1:
        return 1
    return luca(n - 1) + luca(n - 2)


print((luca(N)))

n = int(eval(input()))
luca = [0] * (n + 1)
luca[0] = 2
luca[1] = 1
for i in range(2, n + 1):
    luca[i] = luca[i - 1] + luca[i - 2]
print((luca[n]))

-from functools import lru_cache - -N = int(eval(input())) - - -@lru_cache(maxsize=None) -def luca(n): -    if n == 0: -        return 2 -    if n == 1: -        return 1 -    return luca(n - 1) + luca(n - 2) - - -print((luca(N))) +n = int(eval(input())) +luca = [0] * (n + 1) +luca[0] = 2 +luca[1] = 1 +for i in range(2, n + 1): +    luca[i] = luca[i - 1] + luca[i - 2] +print((luca[n]))