#include using namespace std; int main() { int n, m; double p; cin >> n >> m >> p; if (n > m) swap(n, m); if (n == 1) { if (m == 1) printf("%.10f\n", p); else { double ans = pow(p, 2) * 2 + pow(p, 3) * (m - 2); printf("%.10f\n", ans); } return 0; } double s1 = pow(p, 3) * 4; double s2 = pow(p, 4) * (max(0, n - 2) * 2.0 + max(0, m - 2) * 2.0); double s3 = pow(p, 5) * max(0, n - 2) * max(0, m - 2); printf("%.10f\n", s1 + s2 + s3); }