#include <bits/stdc++.h>
using namespace std;
template <class P, class Q>
inline void smin(P &a, Q b) {
  if (b < a) a = b;
}
template <class P, class Q>
inline void smax(P &a, Q b) {
  if (a < b) a = b;
}
long long n;
vector<long long> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  v.push_back(1);
  v.push_back(2);
  for (int w = 2;; w++) {
    v.push_back(v[w - 1] + v[w - 2]);
    if (v.back() > n) {
      cout << w - 1 << endl;
      return 0;
    }
  }
  return 0;
}
