#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  if (n < 4) {
    cout << n - 1 << endl;
    return 0;
  }
  long long x1 = 0, x2 = 1, count = 1;
  while (x2 < n) {
    long long tmp = x2;
    x2 += 1 + x1;
    x1 = tmp;
    count++;
  }
  cout << count - 1 << endl;
  return 0;
}
