N,M=map(int,input().split()) P=float(input()) ANS=0 if N==1: for j in range(M): if j==0 or j==M-1: ANS+=P**2 else: ANS+=P**3 elif M==1: for i in range(N): if i==0 or i==N-1: ANS+=P**2 else: ANS+=P**3 else: for i in range(N): for j in range(M): if (i==0 or i==N-1) and (j==0 or j==M-1): ANS+=P**3 elif i==0 or j==0 or i==N-1 or j==M-1: ANS+=P**4 else: ANS+=P**5 print(ANS)