n,m=map(int,input().split()) p=float(input()) if n==1 and m==1: print(1-p) elif min(n,m)-1: print(2 * ((1-p)**2) + (max(n,m)-2) * ((1-p)**3)) else: print(4 * ((1-p)**3) + (n+n+m+m-8) * ((1-p)**4) + (n*m-(n+n+m+m-4))*((1-p)**4))