N, P = input().split() M = int(N) + 1 L = [1.0] * M for i in range(2, M): for j in range(i * 2, M, i): L[j] *= 1 - float(P) print(sum(L)-2)