#include <bits/stdc++.h>
using namespace ::std;
int main() {
  vector<uint64_t> P;
  P.push_back(1);
  P.push_back(2);
  int n = 2;
  uint64_t lt = 1000000000;
  lt *= lt;
  while (true) {
    uint64_t t = P[n - 1] + P[n - 2];
    if (t > lt) break;
    P.push_back(t);
    n++;
  }
  uint64_t m;
  cin >> m;
  int ans = 0;
  for (int i = 0; i < P.size(); i++) {
    if (P[i] > m) break;
    ans = i;
  }
  cout << ans << endl;
  return 0;
}
