n,p=list(raw_input().split()) N,P=int(n),float(p) l=[0,0]+[1.0]*(N-1) s=0 q=1-P for i in range(2,N+1): s+=l[i] for j in range(i+i,N+1,i): l[j]*=q print(s)