#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long power(long long base, long long exp);
void solve() {
  long long n;
  cin >> n;
  long long x = 1, y = 1;
  long long ans = 0;
  while (x + y <= n) {
    long long z = x + y;
    x = y;
    y = z;
    ans++;
  }
  cout << ans << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
long long power(long long base, long long exp) {
  base %= 1000000007;
  long long result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((long long)result * base) % 1000000007;
    base = ((long long)base * base) % 1000000007;
    exp >>= 1;
  }
  return result;
}
