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