#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using dd = long double;
namespace {
static bool constexpr dbg = 0;
ll constexpr N = 1e6;
ll n, mn[N];
void init() { cin >> n; }
void solve() {
  mn[0] = 1;
  mn[1] = 2;
  for (ll i = 2; i < N; ++i) mn[i] = mn[i - 1] + mn[i - 2];
  ll i = 1;
  while (n >= mn[i + 1]) ++i;
  cout << i;
}
}  // namespace
int main() {
  if (!dbg) {
    std::ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  }
  cout << fixed << setprecision(20);
  init();
  solve();
  return 0;
}
