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