#include <bits/stdc++.h>
const double PI = acos(-1.0);
using namespace std;
template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& v) {
  is >> v.first >> v.second;
  return is;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (int i = 0; i < v.size(); ++i) {
    is >> v[i];
  }
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
  os << "[";
  for (int i = 0; i < v.size(); ++i) {
    os << v[i];
    if (i != v.size() - 1) os << " ";
  }
  os << "]" << endl;
  return os;
}
template <typename T>
T sign(const int& x) {
  return x == 0 ? 0 : x < 0 ? -x : x;
}
bool isprime(long long n) {
  long long d = sqrt(n) + 1;
  for (long long i = 2; i <= d; ++i) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> f;
  if (n == 2) {
    cout << 1 << endl;
    return 0;
  }
  f.push_back(1);
  f.push_back(1);
  long long sum = 1;
  while (1) {
    if (sum + f.back() > n) {
      break;
    }
    f.push_back(f.back() + f[f.size() - 2]);
    sum = f.back() + f[f.size() - 2];
  }
  cout << f.size() - 1 << endl;
  return 0;
}
