#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  unsigned long long n;
  cin >> n;
  vector<unsigned long long> f{1, 2};
  for (int i = 2; i < 100; i++) {
    unsigned long long new_f = f[i - 1] + f[i - 2];
    f.push_back(new_f);
  }
  int res = 0;
  while (f[res] <= n) res++;
  cout << res - 1 << endl;
}
