N = int(input()) P = float(input()) if N >= 200: ans = 1.0 else: ans = 0.0 s = P for _ in range(N): ans += s s *= 1 - P print(ans)