import sys input = sys.stdin.readline N,M=map(int,input().split()) if N==1: print("NaN") exit() LIST=[0]*(5*10**6) LIST[0]=1 for i in range(1,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<5*10**6: LIST[OK]=1 else: break count=0 for i in range(5*10**6): if LIST[i]==0: count+=1 if count==M: print(i) break