#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long n, a[100];
int main() {
  n = read();
  a[0] = a[1] = 1;
  for (int i = 2;; i++) {
    a[i] = a[i - 1] + a[i - 2];
    if (a[i] > n) {
      cout << i - 2 << endl;
      break;
    }
  }
}
