#include<iostream>
using namespace std;

int main()
{
    int month[1024];
    int index = 0;
    while( cin>>month[index])
    {
         index ++;
    }
    for(int j = 0; j < index; j++)
    {
         int num =1;
        if(month[j] < 1)
        {
            cout << 0;
            return 0;
        }
        if(month[j] == 1 || month[j] == 2)
        {
            cout << 1;
            return 0;
        }
        int tmp = 1;
        for(int i = 2; i<month[j]; i++)
        {
            int x = num;
            num += tmp;
            tmp = x;
        }
        cout << num <<endl;
    }
    return 0;
}