#include <bits/stdc++.h>
int main() {
  long long n;
  std::cin >> n;
  long long k = std::min((n + 1) / 2, 2LL);
  long long p2 = 2;
  long long p1 = 3;
  while (p2 + p1 <= n) {
    long long p3 = p2;
    p2 = p1;
    p1 = p3 + p2;
    ++k;
  }
  std::cout << k << std::endl;
  return 0;
}
