#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const int N = 1e4 + 50;
bool mark[N];
int main() {
  ios::sync_with_stdio(0);
  long long n;
  cin >> n;
  long long a = 1, b = 2, t, ans = 1;
  while (b <= n) {
    t = a + b;
    a = b;
    b = t;
    ans++;
  }
  cout << ans - 1;
  return 0;
}
