#include <bits/stdc++.h>
using namespace std;
long long N, D[100];
int main() {
  int i, cnt;
  cin >> N;
  D[0] = 1, D[1] = 2;
  for (i = 2; i <= 100; i++) {
    D[i] = D[i - 1] + D[i - 2];
    if (D[i] > N) {
      break;
    }
  }
  cout << i - 1;
}
