#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  long long n, games, temp, x, lim;
  cin >> n;
  temp = x = 1;
  games = 0;
  lim = 2;
  while (!(lim > n)) {
    temp = x;
    x = lim;
    lim += temp;
    games++;
  }
  cout << games;
  return 0;
}
