#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  long long n;
  cin >> n;
  int ans = 0;
  n--;
  long long fib[2];
  fib[0] = 1;
  fib[1] = 1;
  while (n - fib[0] >= 0) {
    ans++;
    n -= fib[0];
    long long t = fib[0];
    fib[0] = fib[1];
    fib[1] += t;
  }
  cout << ans << endl;
  return 0;
}
