#include <bits/stdc++.h>
using namespace std;
vector<long long> vec;
long long n;
long long solve(long long i) {
  if (n < vec[i]) return 1;
  vec.push_back(vec[i] + vec[i - 1]);
  return 1 + solve(i + 1);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  vec.push_back(1);
  vec.push_back(2);
  cout << solve(1) - 1;
}
