#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <cstring>
#define mp make_pair
#define pb push_back
#define LL long long
#define inf 2e9
#define zeros x^(x-1)&x
using namespace std;

int main()
{
    LL x,c;
    cin>>x;
    if (x==1)
    {
        cout<<0<<'\n';
    }
    if (x==1)
    {
        cout<<0<<'\n';
        return 0;
    }
    LL a = 0;
    LL b = 1;
    int nr = 0;
    while (x-b>a)
    {
        c = (a+b);
        a=b;
        b=c;
        nr++;
    }
    cout<<nr+1<<'\n';
    return 0;
}