#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> (n);
  if (n == 2)
    cout << 1;
  else if (n >= 3 && n <= 4)
    cout << 2;
  else if (n >= 5 && n <= 7)
    cout << 3;
  else if (n >= 8 && n <= 12)
    cout << 4;
  else if (n >= 13 && n <= 20)
    cout << 5;
  else if (n >= 21 && n <= 33)
    cout << 6;
  else if (n >= 34 && n <= 54)
    cout << 7;
  else if (n >= 55 && n <= 88)
    cout << 8;
  else if (n >= 89 && n <= 143)
    cout << 9;
  else if (n >= 144 && n <= 232)
    cout << 10;
  else if (n >= 233 && n <= 376)
    cout << 11;
  else if (n >= 377 && n <= 609)
    cout << 12;
  else if (n >= 610 && n <= 986)
    cout << 13;
  else if (n >= 987 && n <= 1596)
    cout << 14;
  else if (n >= 1597 && n <= 2583)
    cout << 15;
  else if (n >= 2584 && n <= 4180)
    cout << 16;
  else if (n >= 4181 && n <= 6764)
    cout << 17;
  else if (n >= 6765 && n <= 10945)
    cout << 18;
  else if (n >= 10946 && n <= 17710)
    cout << 19;
  else if (n >= 17711 && n <= 28656)
    cout << 20;
  else if (n >= 28657 && n <= 46367)
    cout << 21;
  else if (n >= 46368 && n <= 75024)
    cout << 22;
  else if (n >= 75025 && n <= 121392)
    cout << 23;
  else if (n >= 121393 && n <= 196417)
    cout << 24;
  else if (n >= 196418 && n <= 317810)
    cout << 25;
  else if (n >= 317811 && n <= 514228)
    cout << 26;
  else if (n >= 514229 && n <= 832039)
    cout << 27;
  else if (n >= 832040 && n <= 1346268)
    cout << 28;
  else if (n >= 1346269 && n <= 2178308)
    cout << 29;
  else if (n >= 2178309 && n <= 3524577)
    cout << 30;
  else if (n >= 3524578 && n <= 5702886)
    cout << 31;
  else if (n >= 5702887 && n <= 9227464)
    cout << 32;
  else if (n >= 9227465 && n <= 14930351)
    cout << 33;
  else if (n >= 14930352 && n <= 24157816)
    cout << 34;
  else if (n >= 24157817 && n <= 39088168)
    cout << 35;
  else if (n >= 39088169 && n <= 63245985)
    cout << 36;
  else if (n >= 63245986 && n <= 102334154)
    cout << 37;
  else if (n >= 102334155 && n <= 165580140)
    cout << 38;
  else if (n >= 165580141 && n <= 267914295)
    cout << 39;
  else if (n >= 267914296 && n <= 433494436)
    cout << 40;
  else if (n >= 433494437 && n <= 701408732)
    cout << 41;
  else if (n >= 701408733 && n <= 1134903169)
    cout << 42;
  else if (n >= 1134903170 && n <= 1836311902)
    cout << 43;
  else if (n >= 1836311903 && n <= 2971215072)
    cout << 44;
  else if (n >= 2971215073 && n <= 4807526975)
    cout << 45;
  else if (n >= 4807526976 && n <= 7778742048)
    cout << 46;
  else if (n >= 7778742049 && n <= 12586269024)
    cout << 47;
  else if (n >= 12586269025 && n <= 20365011073)
    cout << 48;
  else if (n >= 20365011074 && n <= 32951280098)
    cout << 49;
  else if (n >= 32951280099 && n <= 53316291172)
    cout << 50;
  else if (n >= 53316291173 && n <= 86267571271)
    cout << 51;
  else if (n >= 86267571272 && n <= 139583862444)
    cout << 52;
  else if (n >= 139583862445 && n <= 225851433716)
    cout << 53;
  else if (n >= 225851433717 && n <= 365435296161)
    cout << 54;
  else if (n >= 365435296162 && n <= 591286729878)
    cout << 55;
  else if (n >= 591286729879 && n <= 956722026040)
    cout << 56;
  else if (n >= 956722026041 && n <= 1548008755919)
    cout << 57;
  else if (n >= 1548008755920 && n <= 2504730781960)
    cout << 58;
  else if (n >= 2504730781961 && n <= 4052739537880)
    cout << 59;
  else if (n >= 4052739537881 && n <= 6557470319841)
    cout << 60;
  else if (n >= 6557470319842 && n <= 10610209857722)
    cout << 61;
  else if (n >= 10610209857723 && n <= 17167680177564)
    cout << 62;
  else if (n >= 17167680177565 && n <= 27777890035287)
    cout << 63;
  else if (n >= 27777890035288 && n <= 44945570212852)
    cout << 64;
  else if (n >= 44945570212853 && n <= 72723460248140)
    cout << 65;
  else if (n >= 72723460248141 && n <= 117669030460993)
    cout << 66;
  else if (n >= 117669030460994 && n <= 190392490709134)
    cout << 67;
  else if (n >= 190392490709135 && n <= 308061521170128)
    cout << 68;
  else if (n >= 308061521170129 && n <= 498454011879263)
    cout << 69;
  else if (n >= 498454011879264 && n <= 806515533049392)
    cout << 70;
  else if (n >= 806515533049393 && n <= 1304969544928656)
    cout << 71;
  else if (n >= 1304969544928657 && n <= 2111485077978049)
    cout << 72;
  else if (n >= 2111485077978050 && n <= 3416454622906706)
    cout << 73;
  else if (n >= 3416454622906707 && n <= 5527939700884756)
    cout << 74;
  else if (n >= 5527939700884757 && n <= 8944394323791463)
    cout << 75;
  else if (n >= 8944394323791464 && n <= 14472334024676220)
    cout << 76;
  else if (n >= 14472334024676221 && n <= 23416728348467684)
    cout << 77;
  else if (n >= 23416728348467685 && n <= 37889062373143905)
    cout << 78;
  else if (n >= 37889062373143906 && n <= 61305790721611590)
    cout << 79;
  else if (n >= 61305790721611591 && n <= 99194853094755496)
    cout << 80;
  else if (n >= 99194853094755497 && n <= 160500643816367087)
    cout << 81;
  else if (n >= 160500643816367088 && n <= 259695496911122584)
    cout << 82;
  else if (n >= 259695496911122585 && n <= 420196140727489672)
    cout << 83;
  else if (n >= 420196140727489673 && n <= 679891637638612257)
    cout << 84;
  else if (n >= 679891637638612258 && n <= 1100087778366101930)
    cout << 85;
  cout << ("\n");
}
