#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long p;
  cin >> p;
  vector<long long> x;
  x.push_back(1);
  x.push_back(2);
  int n = 2;
  while (x.back() < 1e18) {
    x.push_back(x[n - 2] + x[n - 1]);
    n++;
  }
  int ans = 0;
  for (auto i : x)
    if (i <= p) ans++;
  cout << ans - 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
