#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
int main() {
  long long n;
  cin >> n;
  v.push_back(2);
  v.push_back(3);
  if (n <= 3) {
    if (n == 3) {
      cout << "2";
    } else {
      cout << "1";
    }
    return 0;
  }
  long long j = 2;
  while (v[j - 1] <= n) {
    v.push_back(v[j - 2] + v[j - 1]);
    j++;
  }
  cout << j - 1;
  return 0;
}
