#include <bits/stdc++.h>
using namespace std;
class TaskA {
 public:
  void solve(std::istream& in, std::ostream& out) {
    int64_t n;
    in >> n;
    int64_t a = 1, b = 2;
    for (int step = 2;; ++step) {
      auto c = a + b;
      if (c > n) {
        out << (step - 1) << "\n";
        return;
      }
      a = b;
      b = c;
    }
  }
};
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  TaskA solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
