#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, q(0), k, k1, k2;
  cin >> n;
  k = 1;
  k1 = 0;
  k2 = 0;
  while (n >= k) {
    k2 = k1 + k;
    k1 = k;
    k = k2;
    q++;
  }
  cout << q - 2;
  return 0;
}
