#include <bits/stdc++.h>
using namespace std;
long long a[100];
int main() {
  long long n;
  int i;
  a[1] = 2;
  a[2] = 3;
  for (i = 3; i <= 100; i++) a[i] = a[i - 1] + a[i - 2];
  while (~(scanf("%lld", &n))) {
    for (i = 1; i <= 100; i++) {
      if (a[i] > n) break;
    }
    printf("%d\n", i - 1);
  }
  return 0;
}
