#include <bits/stdc++.h>
using namespace std;
long long n;
long long f[1000007];
void solve() {
  cin >> n;
  f[0] = 1;
  f[1] = 1;
  long long i = 1;
  for (i = 1; f[i] <= n; ++i) f[i + 1] = f[i] + f[i - 1];
  cout << i - 2;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  solve();
  return 0;
}
