#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  long long m = 0;
  cin >> n;
  n--;
  long long f, f1 = 0, f2 = 1;
  while (n >= f2) {
    m++;
    n -= f2;
    f = f2;
    f2 += f1;
    f1 = f;
  }
  cout << m << endl;
  return 0;
}
