n = int(input()) p = float(input()) if(n >= 200): print(1) exit(0) ans = 0 q = 1 for _ in range(n): ans += q * p q *= 1 - p print(ans)