#include <bits/stdc++.h>
using namespace std;
long long int a, b, c, pas;
int main() {
  b = 1, c = 1;
  cin >> a;
  b = 3;
  c = 2;
  pas = 1;
  while (a >= b) {
    long long int x = b;
    b = b + c;
    c = x;
    pas++;
  }
  cout << pas;
}
