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