#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  scanf("%I64d", &n);
  long long a = 2, b = 3;
  int i = 1;
  while (n >= b) {
    long long c = a + b;
    a = b;
    b = c;
    i++;
  }
  printf("%d\n", i);
  return 0;
}
