#include <iostream>
#include <fstream>
#include <climits>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    freopen("data.in", "rt", stdin);    freopen("data.out", "wt", stdout);
    int x;
    scanf("%d", &x);
    int a = 1, b = 1;
    int i = 1;
    while(1) {
        i++;
        int c = a + b;
        a = b;
        b = c;
        if(c > x)
            break;
    }
    cout << i << '\n';


    return 0;
}