#include using namespace std; using ll = long long; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, m; double p; cin >> n >> m >> p; if (n > m) swap(n, m); double ans = 0; if (m == 1) { // n == 1 && m == 1 ans = p; } else if (n == 1) { ans = p * (2 + p * (m - 2)); ans *= p; } else { ll rest = n; rest *= m; rest -= 2 * (n + m) - 4; ans = p * p * (4 + p * (2 * (n + m - 4) + p * rest)); ans *= p; } cout << fixed << setprecision(20) << ans << "\n"; return 0; }