#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using i64 = int64_t; using i32 = int32_t; template T iabs(const T& x) { return max(x, -x); } int main() { i64 n, m; double p; cin >> n >> m >> p; double ans = max(i64(0), (n - 2)) * max(i64(0), (m - 2)) * pow(p, 5); ans += max(i64(0), n - 2) * min(i64(2), m) * pow(p, 4); ans += max(i64(0), m - 2) * min(i64(2), n) * pow(p, 4); ans += min(i64(2), m) * min(i64(2), n) * pow(p, 3); printf("%.10f\n", ans); return 0; }