#include <bits/stdc++.h>
using namespace std;
long long n;
void home() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void enter() { cin >> n; }
int tinh(long long n) {
  if (n == 2) return 1;
  if (n == 3) return 2;
  long long tmp = n >> 1;
  return ((tinh(tmp)) > (tinh(n - tmp)) ? (tinh(tmp)) : (tinh(n - tmp))) + 1;
}
void solve() { cout << tinh(n); }
void lam() {
  if (n == 2) {
    cout << 1;
    return;
  }
  if (n == 3) {
    cout << 2;
    return;
  }
  long long a = 2;
  long long b = 3;
  int res = 2;
  long long c;
  while (true) {
    ++res;
    c = a + b;
    if (c > n) break;
    a = b;
    b = c;
  }
  cout << res - 1;
}
int main() {
  home();
  enter();
  lam();
}
