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