#include <bits/stdc++.h>
using namespace std;
string conv(int n) {
  ostringstream con;
  con << n;
  return con.str();
}
bool found(string m, char a) { return (m.find(a) < m.size()); }
bool prime(unsigned long long n) {
  if (n == 0 || n == 1) {
    return 0;
  } else if (n == 2) {
    return 1;
  } else if (!(n & 1)) {
    return 0;
  }
  for (int i = 3; i <= sqrtl(n) + 1; i += 2) {
    if (!(n % i)) {
      return 0;
    }
  }
  return 1;
}
int main() {
  long long int n, arr[1000], ind = 0;
  arr[0] = 1;
  arr[1] = 2;
  cin >> n;
  for (int i = 2;; i++) {
    arr[i] = arr[i - 1] + arr[i - 2];
    ind++;
    if (arr[i] > n) {
      break;
    }
  }
  cout << ind;
  return 0;
}
