#include <bits/stdc++.h>
using namespace std;
long long n;
long long f[100];
int main() {
  cin >> n;
  if (n < 4) {
    if (n == 2) cout << 1;
    if (n == 3) cout << 2;
  } else {
    f[1] = 2;
    f[2] = 3;
    int i = 2;
    do {
      i++;
      f[i] = f[i - 1] + f[i - 2];
    } while (f[i] <= n);
    i--;
    cout << i << endl;
  }
}
