#include <bits/stdc++.h>
using namespace std;
long long int dp[992];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  ;
  dp[1] = 2;
  dp[2] = 3;
  for (long long int i = 3; i < 992; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  long long int n;
  cin >> n;
  for (long long int i = 1; i < 992; i++) {
    if (dp[i] > n) {
      cout << i - 1;
      break;
    }
  }
}
