from decimal import Decimal as dec n = int(input()) p = dec(input()) if(n < 200): print(dec(1) - (dec(1) - p) ** dec(n)) else: print(1)