import math s = input().split() n = int(s[0]) p = float(s[1]) can = [1.0] * (n + 1) pi = 1 - p for k in range(2, n + 1): for i in range(k + k, n + 1, k): can[i] *= pi res = sum(can[2:]) print(res)