def make_divisors(n): divisors = [] for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n//i) return divisors N, p = input().split() N, p = int(N), float(p) ans = 0 for i in range(2, N+1): c = len(make_divisors(i)) ans += (1 - p) ** (c - 2) print(ans)