#include <bits/stdc++.h>
using namespace std;
void solve(int test_number);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.setf(ios::fixed);
  cout.precision(9);
  cerr.setf(ios::fixed);
  cerr.precision(3);
  int n = 1;
  for (int i = 0; i < n; i++) {
    solve(i);
  }
}
void solve(int test_number) {
  long long n;
  cin >> n;
  if (n == 2) {
    cout << 1 << endl;
    return;
  }
  long long mp[100];
  mp[0] = 1;
  mp[1] = 2;
  int ans = -1;
  for (int i = 2; i < 90; i++) {
    mp[i] = mp[i - 1] + mp[i - 2];
    if (mp[i] > n) {
      break;
    }
    ans = i;
  }
  cout << ans << endl;
}
