#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
long long logPow(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) {
      ans *= a;
    }
    a *= a;
    b = b >> 1;
  }
  return ans;
}
long long solve(long long n) {
  if (n == 0 || n == 1) {
    return 0;
  }
  if (n == 2) {
    return 1;
  }
  long long val1 = 1, val2 = 2;
  long long cur = val1 + val2;
  long long ans = 2;
  while (cur <= n) {
    val1 = val2;
    val2 = cur;
    cur = val1 + val2;
    ans++;
  }
  ans--;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    long long n;
    cin >> n;
    cout << solve(n) << "\n";
  }
  return 0;
}
