#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int n, i, ans;
  unsigned long long A[600];
  A[1] = 1, A[0] = 1;
  cin >> n;
  for (i = 2; i < 600; i++) {
    A[i] = A[i - 1] + A[i - 2];
    if (n >= A[i]) {
      ans = i - 1;
    } else
      break;
  }
  cout << ans;
  return 0;
}
