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