#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> cnt(2);
  cnt[0] = 1;
  cnt[1] = 2;
  while (cnt.back() <= n)
    cnt.push_back(cnt[cnt.size() - 1] + cnt[cnt.size() - 2]);
  cout << cnt.size() - 2 << '\n';
  return 0;
}
