n = int(eval(input()))

ans = 0

l = [2, 1]



for i in range(n-1):

    l.append(l[i]+l[i+1])



print((l[n]))
n = int(eval(input()))

l = [2, 1]



for i in range(n-1):

    l.append(l[i]+l[i+1])



print((l[n]))
n = int(eval(input()))
ans = 0
l = [2, 1]
for i in range(n - 1):
    l.append(l[i] + l[i + 1])
print((l[n]))

n = int(eval(input()))
l = [2, 1]
for i in range(n - 1):
    l.append(l[i] + l[i + 1])
print((l[n]))

-ans = 0