#include <bits/stdc++.h>
const long long mod = 1e9 + 9;
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  long long dp[500] = {0};
  dp[0] = 1, dp[1] = 2;
  for (long long i = 2; i <= 500; i++) dp[i] = dp[i - 1] + dp[i - 2];
  long long i;
  for (i = 0; i <= 500; i++) {
    if (dp[i] > n) break;
  }
  cout << i - 1 << '\n';
  return 0;
}
