let num
while(num = parseInt(readline())){
// dp[i] 表示第 i 月的兔子总数
let dp = new Array(num + 1).fill(0)
dp[1] = 1
dp[2] = 1
dp[3] = 2
for(let i = 4; i <= num; i++){
dp[i] = dp[i - 1] + dp[i - 2]
}
print(dp[num])
}
let num
while(num = parseInt(readline())){
// dp[i] 表示第 i 月的兔子总数
let dp = new Array(num + 1).fill(0)
dp[1] = 1
dp[2] = 1
dp[3] = 2
for(let i = 4; i <= num; i++){
dp[i] = dp[i - 1] + dp[i - 2]
}
print(dp[num])
}