#include <iostream>

using namespace std;
int main()
{
    int x;
    cin >> x;
    
    int twoBefore = 0;
    int oneBefore = 1;
    int fibonacciValue = twoBefore + oneBefore;
    int currentFibonacciNumber = 2;

    while (fibonacciValue < x) {
        twoBefore = oneBefore;
        oneBefore = fibonacciValue;
        fibonacciValue = twoBefore + oneBefore;
        currentFibonacciNumber++;
    }

    cout << currentFibonacciNumber-1;

    return 0;
}