#include <bits/stdc++.h>
using namespace std;
int main() {
  long long num;
  cin >> num;
  if (num == 2) {
    cout << 1;
  } else if (num == 3) {
    cout << 2;
  } else {
    long long preMinNum = 2;
    long long minNum = 3;
    for (int i = 3;; ++i) {
      preMinNum += minNum;
      swap(preMinNum, minNum);
      if (minNum > num) {
        cout << (i - 1);
        break;
      }
    }
  }
  return 0;
}
