#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  scanf("%lld", &n);
  if (n == 2)
    printf("1\n");
  else {
    long long int l = 2;
    long long int c = 3;
    int res = 1;
    while (c <= n) {
      long long int nw = l + c;
      l = c;
      c = nw;
      res++;
    }
    printf("%d\n", res);
  }
}
