#include <bits/stdc++.h>
using namespace std;
const int MAX = 3100100;
unsigned long long dp[MAX], N;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  dp[0] = 1;
  dp[1] = 2;
  for (unsigned long long I = 0; I < MAX; I++)
    if (I > 1) {
      dp[I] = dp[I - 1] + dp[I - 2];
      if (dp[I] > N) {
        cout << I - 1 << endl;
        return 0;
      }
    }
  return false;
}
