import sys input = sys.stdin.readline N,M=map(int,input().split()) if N==1: print("NaN") exit() LIST=[0]*(10**7) LIST[0]=1 for i in range(1,5*10**6+1): OK=0 NG=10**18 while NG>OK+1: mid=(OK+NG)//2 if mid*mid<=N*i*i: OK=mid else: NG=mid if OK<10**7: LIST[OK]=1 else: break count=0 for i in range(10**7): if LIST[i]==0: count+=1 if count==M: print(i) break