a = int(eval(input()))

b = [2, 1]

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

    b.append(b[i-1]+b[i-2])

print((b[a]))

a = int(eval(input()))

b = [2, 1]

for i in range(1, a):

    b.append(b[i] + b[i-1])

print((b[len(b)-1]))

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

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

-for i in range(2, a + 1): -    b.append(b[i - 1] + b[i - 2]) -print((b[a])) +for i in range(1, a): +    b.append(b[i] + b[i - 1]) +print((b[len(b) - 1]))