#include <bits/stdc++.h>
using namespace std;
long long n;
long long sum[1000000];
int main() {
  sum[1] = 2;
  sum[2] = 3;
  cin >> n;
  if (n == 2) {
    cout << 1 << endl;
    return 0;
  }
  if (n == 3) {
    cout << 2 << endl;
    return 0;
  }
  for (int i = 3; i < 1000000; ++i) {
    sum[i] = sum[i - 1] + sum[i - 2];
    if (sum[i] > n) {
      cout << i - 1 << endl;
      break;
    }
  }
}
