N,M = map(int,input().split()) P = float(input()) ANS = 4*P**3 + 2*(N+M-4)*P**4 + max(N-2,0)*max(M-2,0)*P**5 print(ANS)