#include <bits/stdc++.h>
using namespace std;
unsigned long long int fibonocci(unsigned long long int n) {
  unsigned long long int f, f1, f2, i;
  f1 = 1;
  f2 = 2;
  i = 2;
  while (1) {
    f = f1 + f2;
    if (f > n) {
      return i - 1;
    }
    f1 = f2;
    f2 = f;
    i++;
  }
}
int main() {
  unsigned long long int n, i, x;
  cin >> n;
  if (n == 2) {
    cout << 1;
    return 0;
  }
  x = fibonocci(n);
  cout << x;
  return 0;
}
