#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, a = 2, b = 1, c = 1, l = 0;
  cin >> n;
  while (c <= n) {
    l++;
    c = a + b;
    b = a;
    a = c;
  }
  cout << l;
  return 0;
}
