#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
const int mod = 1000000007, MAX = 200005, INF = 1 << 30;
int main() {
  std::ifstream in("text.txt");
  std::cin.rdbuf(in.rdbuf());
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  vector<long long> ans = {1, 2};
  while (ans.back() <= N) {
    ans.push_back(ans[int(ans.size()) - 2] + ans[int(ans.size()) - 1]);
  }
  cout << int(ans.size()) - 2 << endl;
}
