#include using namespace std; long long FIB[81]; int main() { FIB[1] = 1; FIB[2] = 1; for (int i = 3; i < 81; i++)FIB[i] = FIB[i - 1] + FIB[i - 2]; long long n, m; cin >> n >> m; long long yukichan = FIB[n] - m; int cnt = 0; if (yukichan == 0)cnt=0; else if (yukichan < 0)cnt = -1; else { int last = 81; while (yukichan) { for (int i = 1; i < last; i++) { if (FIB[i] > yukichan) { yukichan -= FIB[i - 1]; cnt++; last = i - 1; break; } if (i == last - 1) { yukichan -= FIB[i]; cnt++; last = i; } } } } cout << cnt << endl; return 0; }