#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define i_7 1000000007 #define i_5 1000000005 ll mod(ll a){ ll c=a%i_7; if(c>=0)return c; else return c+i_7; } typedef pair i_i; typedef pair l_l; #define inf 100000000/*10^8*/ #define rep(i,l,r) for(int i=l;i<=r;i++) const double EPS=1E-8; //////////////////////////////////////// int main(){ ll n,m;cin>>n>>m; ll dp[81];dp[1]=1;dp[2]=1;rep(i,3,80)dp[i]=dp[i-1]+dp[i-2]; ll sum=dp[n]-m; int ans=0,pos=n-2; while(sum>0&&pos>=1){ if(dp[pos]<=sum){ sum-=dp[pos]; ans++; } pos--; } if(sum!=0){ cout<<-1;return 0; } cout<