while True:
try:
#获取输入数据
data1 = int(input())
#设置初值
#一个月兔子个数
N1 = 1
#两个月兔子个数
N2 = 0
#三个月以及三个月以上兔子个数
N3 = 0
for n in range(1,data1):
N3 = N3 + N2
N2 = N1
N1 = N3
print(N1+N2+N3)
except:
break