#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int K = 80;
const int N = 2e5 + 5;
const long long INF64 = 1e15 + 5;
vector<long long> f;
long long clever(long long n) {
  n--;
  for (int j = 0; j < f.size(); j++) {
    if (n <= f[j]) {
      return j + 1;
    }
    n -= f[j];
  }
}
void solve() {
  long long a = 1;
  long long b = 2;
  f.push_back(a);
  f.push_back(b);
  for (int j = 1; j <= 85; j++) {
    long long c = a + b;
    a = b;
    b = c;
    f.push_back(c);
  }
  long long n;
  cin >> n;
  cout << clever(n) << endl;
}
int main() {
  cout.sync_with_stdio(false);
  cin.tie(0);
  srand(time(NULL));
  solve();
  return 0;
}
