N,P=[float(e)for e in raw_input().split()] h=[1]*N r=0 for i in range(2,int(N)+1): r+=h[i] for j in range(i*2,int(N)+1,i):h[j]*=1-P print(r)