#include <bits/stdc++.h>
using namespace std;
long long n;
long long f[1002];
int main() {
  cin >> n;
  f[0] = 1, f[1] = 2;
  int k = 2;
  while (1) {
    f[k] = f[k - 1] + f[k - 2];
    if (f[k] > n) break;
    k++;
  }
  cout << k - 1 << endl;
  return 0;
}
