#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int ar[499989], c = 0;
  ar[0] = 1;
  ar[1] = 2;
  c = 1;
  while (ar[c] <= n) {
    c++;
    ar[c] = ar[c - 1] + ar[c - 2];
  }
  cout << c - 1;
  return 0;
}
