#include <bits/stdc++.h>
using namespace std;
long long gcd(long long n1, long long n2) {
  if (n1 % n2 == 0) return n2;
  return gcd(n2, n1 % n2);
}
long long powmod(long long base, long long exponent) {
  long long ans = 1;
  while (exponent) {
    if (exponent & 1) ans = (ans * base) % 1000000007;
    base = (base * base) % 1000000007;
    exponent /= 2;
  }
  return ans;
}
long long fibo[1000006];
int main() {
  long long n;
  cin >> n;
  if (n == 2) {
    cout << 1 << '\n';
    return 0;
  }
  fibo[1] = 2;
  fibo[2] = 3;
  for (int i = 3;; i++) {
    fibo[i] = fibo[i - 1] + fibo[i - 2];
    if (fibo[i] > n) {
      cout << i - 1;
      return 0;
    }
  }
}
