#include <bits/stdc++.h>
using namespace std;
long long n, d[100];
long long tinh(int n) {
  if (d[n]) return d[n];
  if (n == 1) return 2;
  if (n == 0) return 1;
  d[n] = tinh(n - 2) + tinh(n - 1);
  return d[n];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  int i = 2;
  while (tinh(i) <= n) i++;
  cout << i - 1;
  return 0;
}
