#include <bits/stdc++.h>
using namespace std;
long long n, f[1000000];
signed main() {
  scanf("%lld", &n);
  f[0] = 1;
  f[1] = 2;
  for (long long i = 2;; i++) {
    f[i] = f[i - 1] + f[i - 2];
    if (f[i] > n) {
      printf("%lld\n", i - 1);
      return 0;
    }
  }
}
