#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const long long inf = numeric_limits<long long>::max() / 2 - 1;
map<long long, long long> mp;
long long getcnt(long long v) {
  if (mp.find(v) != mp.end()) return mp[v];
  if (v == -1) return 1;
  if (v == 0) return 1;
  if (v == 1) return 2;
  return mp[v] = getcnt(v - 1) + getcnt(v - 2);
}
inline int run() {
  long long n;
  cin >> n;
  n--;
  long long i = 0;
  while (n >= 0) {
    n -= getcnt(i - 1);
    i++;
  }
  cout << i - 1;
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  run();
  return 0;
}
