#include <bits/stdc++.h>
using namespace std;
const int N = 105;
long long n, f[N];
int main() {
  f[0] = 1, f[1] = 2;
  for (int i = 2; i <= 100; i++) f[i] = f[i - 1] + f[i - 2] + 1;
  scanf("%I64d", &n);
  for (int i = 1; i <= 100; i++)
    if (f[i] >= n) {
      printf("%d\n", i);
      break;
    }
  return 0;
}
