using System;
using System.Collections.Generic;

class ErJingZhi
{
    static void Main()
    {
        string S;
        while ((S = Console.ReadLine()) != null)
        {
            int Input = int.Parse(S);
            int OneSL = 1;
            int X = 1;
            int Y = 1;
            int Z = 2;
            int OneSLY = 0;

            if (Input <= 2)
            {
                Console.WriteLine('1');
            }
            else if(Input >4)
            {
                for (int i = 4; i< Input; i++)
                {
                    Z = X + Y;
                    X = Y;
                    OneSLY = X;
                    Y = Z;
                }
                OneSL = Z * 2 + OneSLY;
                Console.WriteLine(OneSL);
            }
            else
            {
                Console.WriteLine(Input-1);
            }

        }
    }
}