#include <bits/stdc++.h>
using namespace std;
long long n;
long long s[90];
int main() {
  cin >> n;
  s[1] = 2;
  s[2] = 3;
  for (int i = 3; i < 90; i++) s[i] = s[i - 1] + s[i - 2];
  cout << (int)(upper_bound(s, s + 90, n) - s) - 1 << "\n";
  return 0;
}
