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