#include <bits/stdc++.h>
using namespace std;
long long a[1000007];
int main() {
  ios_base::sync_with_stdio(false);
  ;
  long long n;
  cin >> n;
  a[0] = 0;
  a[1] = 1;
  for (long long i = 2;; i++) {
    a[i] = a[i - 1] + a[i - 2];
    if (a[i] <= n) continue;
    cout << i - 3;
    exit(0);
  }
}
