#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long n;
  cin >> n;
  if (n == 2) {
    cout << 1 << endl;
  } else {
    int ans = 2;
    for (unsigned long long ll = 1, l = 2, t = 3; t <= n; ans++) {
      ll = l;
      l = t;
      t += ll;
    }
    cout << ans - 1 << endl;
  }
  return 0;
}
