#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int minplayer[91];
  minplayer[1] = 2;
  for (int i = 2; i <= 90; i++) {
    minplayer[i] = 3;
    for (int j = 1; j < i - 1; j++) {
      minplayer[i] = minplayer[i] + minplayer[j];
    }
  }
  int counter = 0;
  while (n >= minplayer[counter + 1]) {
    counter++;
  }
  cout << counter;
  return 0;
}
