#include <bits/stdc++.h>
int main() {
  using namespace std;
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int64_t N;
  cin >> N;
  --N;
  int64_t first = 1, second = 1;
  int64_t sum = first;
  int res = 1;
  while (sum <= N - second) {
    sum += second;
    swap(first, second);
    second += first;
    ++res;
  }
  cout << res << "\n";
  return 0;
}
