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