#include using namespace std; int main() { int n, m; cin >> n >> m; double p; cin >> p; if (n > m) swap(n, m); double ans; if (n == 1) { if (m == 1) ans = p; else ans = p*p*(2.0 + p*(m-2)); } else { ans = p*p*p*(4.0 + p*(2*m+2*n-8) + p*p*(m-2)*(n-2)); } printf("%.10f\n", ans); return 0; }