n = int(input()) p = float(input()) if not(1 <= n <= 1000 and 0 < p < 1): exit(1) if(n < 200): print(1 - (1 - p) ** n) else: print(1)