#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n;
  cin >> n;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  if (n == 2) {
    cout << 1 << endl;
    return 0;
  }
  long long x = 1, y = 1, curN = 1;
  for (long long i = 3; i <= n;) {
    curN++;
    long long z = x + y;
    x = y;
    y = z;
    i = i + z;
  }
  cout << curN << endl;
  return 0;
}
