N,M=map(int,input().split()) m=a=0 if N<2:M,a=0,"NaN" while M: a+=1 x=a*a while x>m*m*N:m+=1 M-=m*m*N>=x+a*2+1 print(a)