#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  int wyn = 0;
  long long a, b;
  cin >> n;
  a = 1;
  m = 2;
  while (m <= n) {
    wyn++;
    b = m;
    m += a;
    a = b;
  }
  cout << wyn << "\n";
}
