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