#include <bits/stdc++.h>
using namespace std;
unsigned long long num[100] = {0};
int main() {
  unsigned long long n;
  cin >> n;
  num[0] = 1;
  num[1] = 2;
  for (int i = 2; i < 87; ++i) num[i] = num[i - 1] + num[i - 2];
  for (int i = 86; i >= 0; --i) {
    if (n >= num[i]) {
      cout << i;
      break;
    }
  }
  return 0;
}
