N,p = input().split() N = int(N); p = float(p) dp = [0]*(N+1) for i in range(2,N+1): for j in range(1,N//i+1): dp[i*j] += 1 ans = 0 for i in range(2,N+1): ans += (1-p)**(dp[i]-1) print(ans)