def return_Lucas(num1, num2):

  return num1 + num2



n = int(eval(input()))



n1 = 2

n2 = 1

if n == 0:

  print(n1)

elif n == 1:

  print(n2)

else:  

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

    n1, n2 = n2, return_Lucas(n1,n2)

    if i == n:

      print(n2)

      
n = int(eval(input()))



n1 = 2

n2 = 1

if n == 0:

  print(n1)

elif n == 1:

  print(n2)

else:  

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

    n1, n2 = n2, n1+n2

    if i == n:

      print(n2)

      

def return_Lucas(num1, num2):
    return num1 + num2


n = int(eval(input()))
n1 = 2
n2 = 1
if n == 0:
    print(n1)
elif n == 1:
    print(n2)
else:
    for i in range(2, n + 1):
        n1, n2 = n2, return_Lucas(n1, n2)
        if i == n:
            print(n2)

n = int(eval(input()))
n1 = 2
n2 = 1
if n == 0:
    print(n1)
elif n == 1:
    print(n2)
else:
    for i in range(2, n + 1):
        n1, n2 = n2, n1 + n2
        if i == n:
            print(n2)

-def return_Lucas(num1, num2): -    return num1 + num2 - - -        n1, n2 = n2, return_Lucas(n1, n2) +        n1, n2 = n2, n1 + n2