#include <bits/stdc++.h>
using namespace std;
int Solve(long long n) {
  int ans = 0;
  --n;
  long long a = 0, b = 1;
  while (n >= b) {
    n -= b;
    ++ans;
    a += b;
    swap(a, b);
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
  long long n;
  cin >> n;
  cout << Solve(n);
  return 0;
}
