#include #include #include using ldouble = long double; using lint = long long; void solve() { lint n, m; ldouble p; std::cin >> n >> m >> p; if (n > m) std::swap(n, m); ldouble ans; if (n == 1) { if (m == 1) { ans = p; } else { ans = std::pow(p, 2) * 2 + std::pow(p, 3) * (m - 2); } } else { ans = std::pow(p, 3) * 4 + std::pow(p, 4) * ((n + m) * 2 - 8) + std::pow(p, 5) * (n - 2) * (m - 2); } std::cout << std::fixed << std::setprecision(10) << ans << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }