#include <bits/stdc++.h>
using namespace std;
long long f[100];
int main() {
  f[0] = 1;
  f[1] = 2;
  for (int i = 2; f[i - 1] < (1LL << 60); ++i) f[i] = f[i - 1] + f[i - 2];
  long long n;
  cin >> n;
  long long s = 0;
  for (int i = 0;; ++i) {
    if (f[i] <= n)
      s = i;
    else
      break;
  }
  printf("%lld\n", s);
  return 0;
}
