import java.util.Scanner; public class Main { public static void main(String[] args) {(new Solve()).solve();} } class Solve{ void solve(){ Scanner in = new Scanner(System.in); int n = in.nextInt(); long m = in.nextLong(); System.out.println(getMistake(n, m)); in.close(); } int getMistake(int n, long m){ long[] fib = new long[n]; fib[0] = fib[1] = 1; for(int i=2; i=0; i--){ if(diff>=fib[i]){ diff -= fib[i]; count++; } if(diff==0) return count; } return -1; } }