#include <bits/stdc++.h>
using namespace std;
long long F[10000];
long long limit = 1000000000000000000LL;
int main() {
  long long n;
  F[1] = 2;
  F[2] = 3;
  for (int i = 3;; i++) {
    F[i] = F[i - 1] + F[i - 2];
    if (F[i] > limit) break;
  }
  while (cin >> n) {
    int pos = 1;
    for (int i = 1;; i++) {
      pos = i;
      if (F[i] > n) break;
    }
    cout << pos - 1 << endl;
  }
}
