#include <bits/stdc++.h>
using namespace std;
const long long INF = LLONG_MAX / 3;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  vector<long long> dp(2);
  dp[0] = 1;
  dp[1] = 2;
  while (1) {
    long long val = dp[(int)(dp).size() - 1] + dp[(int)(dp).size() - 2];
    if (val > (long long)1e18) break;
    dp.push_back(val);
  }
  long long n;
  while (cin >> n) {
    for (int i = (int)(dp).size() - 1; i >= 0; --i)
      if (n >= dp[i]) {
        cout << i << endl;
        break;
      }
  }
}
