#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int mo = 1000000007;
const int inf = 0x3f3f3f3f;
const int INF = 2000000000;
long long dp[200008];
int main() {
  long long n;
  scanf("%I64d", &n);
  dp[1] = 2;
  dp[2] = 3;
  dp[3] = 5;
  int num = 3;
  while (dp[num] < (long long)1e18) {
    num++;
    dp[num] = dp[num - 1] + dp[num - 2];
  }
  int x = upper_bound(dp + 1, dp + num + 1, n) - dp - 1;
  cout << x << endl;
}
