#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long N = 1e6 + 5;
long long n, ans = 1;
inline long long read() {
  long long a = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) a = (a << 3) + (a << 1) + ch - '0';
  return a * f;
}
signed main() {
  n = read();
  long long x = 1, y = 2, z = 3;
  while (z <= n) {
    x = y;
    y = z;
    z = x + y;
    ans++;
  }
  printf("%lld\n", ans);
  return 0;
}
