#include <bits/stdc++.h>
using namespace std;
const int N = 100100, mod = 1e9 + 7;
inline int read() {
  int x = 0, c = getchar(), f = 0;
  for (; c > '9' || c < '0'; f = c == '-', c = getchar())
    ;
  for (; c >= '0' && c <= '9'; c = getchar()) x = (x << 1) + (x << 3) + c - '0';
  return f ? -x : x;
}
inline void write(int x) {
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
int dfs(long long x) {
  if (x == 1) return 0;
  return dfs((x + 1) / 2) + 1;
}
long long n, f[110];
int i;
int main() {
  scanf("%I64d", &n);
  f[0] = 1;
  f[1] = 2;
  for (i = 1; f[i] <= n; i++) f[i + 1] = f[i] + f[i - 1];
  printf("%d\n", i - 1);
  return 0;
}
