#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  long long n;
  cin >> n;
  if (n == 2) {
    cout << 1;
  } else {
    long long a = 2, b = 3;
    long long ans;
    for (ans = 2; b <= n; ans++) {
      long long tmp = b;
      b = a + b;
      a = tmp;
    }
    cout << ans - 1LL;
  }
}
