#include <bits/stdc++.h>
using namespace std;
const int nn = 100;
long long p[100];
bool a[nn];
long long num;
int main() {
  p[0] = 1;
  p[1] = 2;
  for (int i = 2; i <= nn; i++) {
    p[i] = p[i - 1] + p[i - 2];
  }
  long long n;
  cin >> n;
  long long pp;
  for (int i = 0; i < nn; i++) {
    if (n < p[i + 1] && n >= p[i]) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}
