#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) {
    long long int n, i;
    cin >> n;
    long long int fib[150];
    fib[0] = 1;
    fib[1] = 2;
    for (i = 2; i <= 100; i++) fib[i] = fib[i - 1] + fib[i - 2];
    for (i = 0; fib[i] <= n; i++)
      ;
    cout << i - 1 << "\n";
  }
  return 0;
}
