#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); using ld = long double; ld N,M,P; cin >> N >> M >> P; if(N > M) swap(N, M); ld ans = 0; if(M == 1) { ans += P; } else if(N == 1) { // k = 1 : 2マス // k = 2 : M-2マス ans += 2.0 * powl(P, 1 + 1); ans += (M - 2) * powl(P, 2 + 1); } else { // k = 2 : 4マス // k = 3 : 2(N-2+M-2)マス // k = 4 : (N-1)(M-1)マス ans += 4.0 * powl(P, 2 + 1); ans += 2.0 * (N - 2 + M - 2) * powl(P, 3 + 1); ans += (N - 2) * (M - 2) * powl(P, 4 + 1); } cout << fixed << setprecision(20) << ans << endl; }