#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long n;
  cin >> n;
  if (n == 2) {
    cout << "1";
    return 0;
  }
  if (n == 3) {
    cout << "2";
    return 0;
  }
  n -= 4;
  unsigned long long a = 1, b = 2, c = 0, count = 2;
  while (n > 0) {
    ++count;
    c = a + b;
    a = b;
    b = c;
    if (n < c)
      break;
    else
      n -= c;
  }
  cout << count;
  return 0;
}
