#include <bits/stdc++.h>
using namespace std;
const int Inf = 1e9 + 7;
long long f[1000000];
void solve() {
  long long n;
  cin >> n;
  if (n <= 2) {
    cout << "1" << '\n';
    return;
  }
  f[0] = 1;
  f[1] = 2;
  for (long long k = 2;; k++) {
    f[k] = f[k - 1] + f[k - 2];
    if (f[k] > n) {
      k--;
      cout << k << '\n';
      return;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(9);
  cout << fixed;
  solve();
  return 0;
}
