#include <bits/stdc++.h>
using namespace std;
template <typename... T>
void read(T &...args) {
  ((cin >> args), ...);
}
template <typename... T>
void write(T &&...args) {
  ((cout << args << " "), ...);
}
template <typename... T>
void writen(T &&...args) {
  ((cout << args << "\n"), ...);
}
template <typename... T>
void cn(T &&...args) {
  ((cout << args << " "), ...);
  cout << "\n";
}
void deb(long long x) { cout << x; }
void deb(float x) { cout << x; }
void deb(double x) { cout << x; }
void deb(long double x) { cout << x; }
void deb(char x) { cout << '\'' << x << '\''; }
void deb(const char *x) { cout << '\"' << x << '\"'; }
void deb(const string &x) { cout << '\"' << x << '\"'; }
void deb(bool x) { cout << (x ? "true" : "false"); }
template <typename T, typename V>
void deb(const pair<T, V> &x) {
  cout << '{';
  deb(x.first);
  cout << ',';
  deb(x.second);
  cout << '}';
}
template <typename T>
void deb(const T &x) {
  long long f = 0;
  cout << '{';
  for (auto &i : x) cout << (f++ ? "," : ""), deb(i);
  cout << "}";
}
void deb1() { cout << "]\n"; }
template <typename T, typename... V>
void deb1(T t, V... v) {
  deb(t);
  if (sizeof...(v)) cout << ", ";
  deb1(v...);
}
long long bin(long long a, long long b, long long mod) {
  if (b == 0) return 1;
  if (b % 2 == 0) return bin((a * a) % mod, b / 2, mod) % mod;
  return ((a % mod) * (bin((a * a) % mod, b / 2, mod) % mod)) % mod;
}
void solve() {
  long long n;
  read(n);
  long long fib[1005];
  fib[1] = 2;
  fib[2] = 3;
  if (n == 2) {
    cout << 1;
    return;
  }
  if (n == 3) {
    cout << 2;
    return;
  }
  for (long long i = 3; i < 1005; i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
    if (fib[i] > n) {
      cout << i - 1;
      break;
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
