#include <bits/stdc++.h>
using namespace std;
long long fib[50010];
int main() {
  long long n;
  cin >> n;
  fib[0] = 1;
  fib[1] = 2;
  if (n == 1) {
    cout << 0;
    return 0;
  } else if (n == 2) {
    cout << 1;
    return 0;
  }
  int i = 1;
  while (fib[i] <= n) {
    ++i;
    fib[i] = fib[i - 2] + fib[i - 1];
  }
  --i;
  cout << i;
}
