N = int(input()) P = float(input()) if N >= 200: print(1) exit() x = P for i in range(N - 1): a = (1 - x) * P x += a print(x)