#include <bits/stdc++.h>
using namespace std;
signed long long N;
signed long long F[100];
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> N;
  F[1] = 2;
  F[2] = 3;
  if (N == 2) return (void)printf("1\n");
  if (N == 3) return (void)printf("2\n");
  for (i = 3; i <= 100; i++) {
    F[i] = F[i - 1] + F[i - 2];
    if (N < F[i]) return (void)printf("%d\n", i - 1);
  }
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  solve();
  return 0;
}
