#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a = 0, b = 1, c;
    for (long long int i = 0;; i++) {
      c = a + b;
      a = b;
      b = c;
      if (b > n) {
        cout << (i - 1);
        break;
      }
    }
  }
}
