#include <bits/stdc++.h>
using namespace std;
long long int dp[102];
int main() {
  long long int n;
  scanf("%lld", &n);
  if (n == 2) {
    puts("1");
    return 0;
  }
  dp[1] = 2;
  dp[2] = 3;
  int i = 0;
  for (i = 3; dp[i - 1] <= n; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  i--;
  while (dp[i] > n) {
    i--;
  }
  cout << i << endl;
  return 0;
}
