import math
from math import log2 as l
from math import pow as p
from fractions import Fraction as f
from sympy import *
def c(a,b):
return math.factorial(a)//(math.factorial(a-b)*math.factorial(b))
p=symbols('p')
ans=1-(1-(1-p)**2)**3
ans=simplify(ans)
print(ans)



