#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long int dp[(long long int)1e5 + (long long int)1e6];
long long int n;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  dp[0] = 1;
  dp[1] = 2;
  if (n == 2) {
    cout << "1";
    cout << endl;
    return 0;
  }
  long long int mx = 0;
  for (long long int j = 2; j <= 1000; j += 1) {
    dp[j] = dp[j - 1] + dp[j - 2];
    if (dp[j] > n) {
      break;
    }
    mx = j;
  }
  cout << mx << endl;
  return 0;
}
