#include <bits/stdc++.h>
using namespace std;
int64_t fnc(int64_t m) {
  if (m == 1) return 0;
  if (m == 2) return 1;
  int64_t a = 1, b = 2;
  int64_t i = 2;
  for (; a + b <= m; i++) {
    swap(a, b);
    b += a;
  }
  return i - 1;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int64_t m;
  cin >> m;
  cout << fnc(m) << endl;
  return 0;
}
