N,P = map(str,input().split()) N = int(N) P = float(P) ans = [1]*(N+1) ans[0] = 0 ans[1] = 0 for i in range(2,N+1): nex = i for j in range(2,10**7): if nex*j > N: break ans[nex*j] *= (1-P) print(sum(ans))