#include <bits/stdc++.h>
using namespace std;
long long fib[100];
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  fib[0] = 1;
  fib[1] = 1;
  for (int i = 2; i <= 87; i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
  }
  long long n;
  cin >> n;
  for (int i = 2; i <= 87; i++) {
    if (fib[i] > n) {
      cout << i - 2 << "\n";
      return 0;
    }
  }
  return 0;
}
