N, M = map(int, input().split()) P = float(input()) 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)