#include <bits/stdc++.h>
using namespace std;
const long long N = 1000010;
const double eps = 1e-6;
const double pi = 4 * atan(1);
long long n, a[N], k, res = 1e18;
int solve() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  if (n == 2)
    cout << "1" << endl;
  else if (n == 3)
    cout << "2" << endl;
  else {
    long long x = 2, y = 3, k = 2;
    res = y;
    while (res < n) {
      if (x + y > n) break;
      res = x + y;
      x = y;
      y = res;
      k++;
    }
    cout << k << endl;
  }
  return 0;
}
int main() { return solve(); }
