#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int mod = 1000000007;
const double PI = acos(-1.0);
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
int n, m;
long long a[100];
int ans;
bool is_prime(long long x) {
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
int main() {
  long long n;
  cin >> n;
  a[1] = 2;
  a[2] = 3;
  for (int i = 3; i <= 89; i++) {
    a[i] = a[i - 1] + a[i - 2];
  }
  for (int i = 1; i <= 89; i++) {
    if (n < a[i])
      break;
    else
      ans = i;
  }
  cout << ans << endl;
  return 0;
}
