#include <bits/stdc++.h>
using namespace std;
map<char, int> m, n;
vector<string> v;
int main() {
  unsigned long long int a, b, c, d, e, i, j, p, q, lo = 0, hi = 2000000000,
                                                    mid, ans;
  unsigned long long int x[100002], y[100002];
  cin >> a;
  if (a == 2) {
    cout << 1;
    return 0;
  }
  if (a == 3) {
    cout << 2;
    return 0;
  }
  a = a - 1;
  x[1] = 1;
  x[2] = 1;
  y[1] = 1;
  y[2] = 2;
  p = 2;
  ans = 0;
  for (i = 3; i <= 85; i++) {
    x[i] = x[i - 1] + x[i - 2];
    y[i] = y[i - 1] + x[i];
    if (y[i] <= a) {
      ans = i;
    } else {
      break;
    }
  }
  if (ans == 0) ans = 2;
  printf("%llu", ans);
  return 0;
}
