#include <bits/stdc++.h>
using namespace std;
const pair<int, int> Dir[8] = {{0, 1}, {0, -1}, {1, 0},   {-1, 0},
                               {1, 1}, {1, -1}, {-1, -1}, {-1, 1}};
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
signed main() {
  long long n;
  scanf("%lld", &n);
  long long dp[2] = {1, 2};
  long long turn = 1;
  while (1) {
    long long next = dp[0] + dp[1];
    if (next > n) {
      break;
    }
    dp[0] = dp[1];
    dp[1] = next;
    turn++;
  }
  printf("%lld\n", turn);
  return 0;
}
