#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> dp(1e5, 0);
  dp[0] = 0;
  dp[1] = 1;
  int i;
  for (i = 2; i < dp.size(); i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
    if (dp[i] > n) break;
  }
  cout << i - 3;
}
int main() {
  solve();
  return 0;
}
