n,p=input().split() n=int(n) p=float(p) q=[0]*(n+1) for i in range(2,n+1): for j in range(i+i,n+1,i): q[j]+=1 print(sum((1-p)**q[i] for i in range(2,n+1)))