#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int nb_max = 1000000000000000000;
  long long int fib_1 = 1;
  long long int fib_2 = 1;
  long long int to_add = 2;
  vector<long long int> fibo;
  long long int nb_fibo = 0;
  while (to_add <= nb_max) {
    fibo.push_back(to_add);
    fib_1 = fib_2;
    fib_2 = to_add;
    to_add = fib_1 + fib_2;
    nb_fibo++;
  }
  long long int n;
  cin >> n;
  long long int small = 0;
  long long int big = nb_fibo - 1;
  long long int mid = big / 2;
  while (big - small != 1) {
    if (fibo[mid] <= n) {
      small = mid;
      mid = (big + small) / 2;
    } else {
      big = mid;
      mid = (big + small) / 2;
    }
  }
  if (fibo[big] > n)
    cout << small + 1 << endl;
  else
    cout << big + 1 << endl;
}
