#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 9;
long long maxdis[100], mindis[100];
int main() {
  long long n;
  cin >> n;
  if (n == 2) {
    cout << 1;
    return 0;
  }
  if (n <= 4) {
    cout << 2;
    return 0;
  }
  if (n <= 7) {
    cout << 3;
    return 0;
  }
  mindis[2] = 3;
  mindis[3] = 5;
  maxdis[0] = 0;
  for (int i = 4; i < 100; i++) {
    mindis[i] = mindis[i - 1] + mindis[i - 2];
    if (mindis[i] > n) {
      cout << i - 1;
      return 0;
    }
  }
  return 0;
}
