N, M = map(int, input().split()) P = float(input()) if N==1 and M==1: print(P) elif N==1 or M==1: ans = (max(0,N-2)+max(0,M-2))*P**3 ans += 2*P**2 print(ans) else: ans = max(0,N-2)*max(0,M-2)*P**5 ans += (2*max(0,N-2)+2*max(0,M-2))*P**4 ans += 4*P**3 print(ans)