#include <bits/stdc++.h>
using namespace std;
long long n, i, a[300001];
int main() {
  cin >> n;
  a[0] = 1;
  a[1] = 1;
  i = 1;
  while (a[i] <= n) {
    i++;
    a[i] = a[i - 1] + a[i - 2];
  }
  cout << i - 2 << endl;
}
