#include <bits/stdc++.h>
using namespace std;
int main() {
  iostream::sync_with_stdio(0);
  long long n;
  cin >> n;
  vector<long long> q{1, 1};
  while (q.back() < 1e18) q.push_back(q.back() + q[q.size() - 2]);
  cout << upper_bound(q.begin(), q.end(), n) - q.begin() - 2;
  return 0;
}
