N,M=map(int,input().split()) F=[1,1] for i in range(80): F.append(F[-1]+F[-2]) if F[N-1]==M: print(0) exit() if F[N-1]=F[i]: ANS+=1 MINUS-=F[i] print(ANS)