N, exe_prob = map(float, input().split()) N = int(N) div_count = [0]*(N+1) for p in range(2, N+1): for q in range(p*2, N+1, p): div_count[q] += 1 ans = 0 for i in range(2, N+1): if div_count[i] == 0: ans += 1 else: ans += pow(1-exe_prob, div_count[i]) print(ans)