#include <bits/stdc++.h>
using namespace std;
long long temp, n, f[165], Max;
int Left, Right, Mid;
int main() {
  Max = 1e18;
  f[1] = 2, f[2] = 3;
  for (int i = 3;; i++) {
    temp = f[i - 2] + f[i - 1];
    if (temp > Max) break;
    Right = i;
    f[i] = temp;
  }
  Left = 1;
  cin >> n;
  while (Left < Right) {
    Mid = Left + (Right - Left + 1) / 2;
    if (f[Mid] <= n)
      Left = Mid;
    else
      Right = Mid - 1;
  }
  cout << Left << endl;
  return 0;
}
