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