#include <bits/stdc++.h>
using namespace std;
struct less_key {
  bool operator()(pair<int64_t, int64_t> p1, pair<int64_t, int64_t> p2) {
    return (p1.first < p2.first) || (p1.second < p2.second);
  }
};
struct pair_hash {
  std::size_t operator()(const pair<int64_t, int64_t>& k) const {
    return static_cast<size_t>(k.first ^ k.second);
  }
};
const int64_t mod = 1000000007;
int64_t n;
int64_t a[3];
int main() {
  cin >> n;
  int64_t i = 1;
  a[0] = 1;
  a[1] = 2;
  for (;;) {
    if (a[1] > n) {
      cout << i - 1;
      return 0;
    }
    int64_t t = a[0] + a[1];
    swap(a[0], a[1]);
    a[1] = t;
    i++;
  }
  return 0;
}
