#include <bits/stdc++.h>
int main() {
  long long n, f[95];
  int j;
  scanf("%lld", &n);
  f[1] = 2;
  f[2] = 3;
  for (int i = 3; i <= 91; i++) {
    f[i] = f[i - 1] + f[i - 2];
  }
  for (j = 1; j <= 91; j++) {
    if (f[j] > n) break;
  }
  printf("%d\n", j - 1);
  return 0;
}
