#include using namespace std; typedef long long ll; int main() { ll h, w; double p; cin >> h >> w; cin >> p; if (h == 1 && w == 1) p = p; else if (h == 1) p = 2 * pow(p, 2) + pow(p, 3) * (w - 2); else if (w == 1) p = 2 * pow(p, 2) + pow(p, 3) * (h - 2); else p = 4 * pow(p, 3) + pow(p, 4) * (2*(h + w - 4)) + pow(p, 5) * ( (h-2) * (w-2) ); printf("%.8f\n" , p); return 0; }