# 数kが残る N,P = input().split() N = int(N) P = float(P) ls = [1]*(N+1) ans = 0 for i in range(2,N+1): ans += ls[i] x = ls[i] k = 2 while i * k <= N: ls[i*k] *= (1-P) k += 1 print(ans)