#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) begin(v),end(v) template inline bool chmax(A & a, const B & b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(A & a, const B & b) { if (a > b) { a = b; return true; } return false; } using ll = long long; using pii = pair; constexpr ll INF = 1ll<<30; constexpr ll longINF = 1ll<<60; constexpr ll MOD = 1000000007; constexpr bool debug = false; //---------------------------------// int main() { int N, M; double P; cin >> N >> M >> P; double Q = 1 - P; if (N == 1 && M == 1) { printf("%.7f\n", P); return 0; } if (N > M) swap(N, M); if (N == 1) { printf("%.16f\n", pow(P, 2) * 2 + (M >= 3 ? pow(P, 3) * (M - 2): 0)); return 0; } ll NM = (ll)N * M; double ee = pow(P, 3); double em = pow(P, 4); double mm = pow(P, 5); double ans = ee * 4; if (N >= 3) ans += 2 * (N - 2) * em; if (M >= 3) ans += 2 * (M - 2) * em; if (N >= 3 && M >= 3) ans += (ll)(N - 2) * (M - 2) * mm; printf("%.16f\n", ans); }