#include <bits/stdc++.h>
using namespace std;
inline int setBit(int N, int pos) { return N = N | (1 << pos); }
inline int resetBit(int N, int pos) { return N = N & ~(1 << pos); }
inline bool checkBit(int N, int pos) { return (bool)(N & (1 << pos)); }
const unsigned long long MAX = 1000000000000000000;
unsigned long long fib[100];
int key;
void pre() {
  fib[0] = 2;
  fib[1] = 3;
  for (key = 2;; key++) {
    fib[key] = fib[key - 1] + fib[key - 2];
    if (fib[key] >= MAX) break;
  }
}
int main() {
  unsigned long long n;
  pre();
  while (cin >> n) {
    for (int i = key; i >= 0; i--) {
      if (n >= fib[i]) {
        cout << i + 1 << '\n';
        break;
      }
    }
  }
  return 0;
}
