#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
int posMod(int a, int m) { return ((a % m) + m) % m; }
int Set(int N, int pos) { return N = N | (1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
int main() {
  long long n;
  cin >> n;
  long long arr[1001];
  arr[1] = 2;
  arr[2] = 3;
  arr[3] = 5;
  for (int i = (4); i <= (1000); i++) {
    arr[i] = arr[i - 1] + arr[i - 2];
  }
  int i = 1;
  while (arr[i] <= n) {
    i++;
  }
  cout << i - 1 << endl;
  return 0;
}
