#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 * 100 + 10;
long long f[MAXN];
int main() {
  long long n;
  cin >> n;
  if (n == 1)
    cout << 0 << endl;
  else if (n == 2)
    cout << 1 << endl;
  else {
    long long ans = 0;
    f[0] = 1, f[1] = 2;
    for (int i = 2; i < 90; i++) {
      f[i] = f[i - 1] + f[i - 2];
      if (n < f[i]) {
        ans = i - 1;
        break;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
