#include <iostream>
using namespace std;
long fib_table[101] = {};
long fib(int n){
if(n == 1){
return 1;
}
if(n == 2){
return 2;
}
if(fib_table[n] == 0){
fib_table[n] = fib(n-1) + fib(n-2);
}
return fib_table[n];
}
int main(){
long n;
while(cin >> n){
if (n == 0){
break;
}
cout << fib(n) << endl;
}
return 0;
}