#include <bits/stdc++.h>
using namespace std;
long long N, sz = 3;
long long arr[10000];
int binser(int l, int r, long long target) {
  if (l <= r) {
    int m = l + (r - l) / 2;
    if (arr[m] <= target) {
      return max(m, binser(m + 1, r, target));
    } else {
      return binser(l, m - 1, target);
    }
  }
  return 0;
}
int main() {
  cin >> N;
  arr[0] = 1;
  arr[1] = 2;
  arr[2] = 3;
  while (arr[sz - 1] <= 1e18) {
    arr[sz] = arr[sz - 1] + arr[sz - 2];
    sz += 1;
  }
  cout << binser(1, sz, N) << endl;
}
