#include <bits/stdc++.h>
using namespace std;
long long a[3010];
long long n;
int main() {
  a[1] = 2;
  a[2] = 3;
  for (int i = 3; i <= 400; i++) a[i] = a[i - 1] + a[i - 2];
  cin >> n;
  int l = 1, r = 400, mid;
  while (l != r) {
    mid = l + r + 1 >> 1;
    if (a[mid] > n)
      r = mid - 1;
    else
      l = mid;
  }
  printf("%d", l);
}
