#!/usr/bin/python2 # -*- coding: utf-8 -*- # † def f(N, M, p): if N > M: N, M = M, N s = [0] * 5 if N == 1: if M > 1: s[1] = 2 s[2] = M-2 else: s[2] = 4 s[3] = 2 * (N-2 + M-2) s[4] = (N-2) * (M-2) res = N*M * p for i in [1, 2, 3, 4]: res -= s[i] * (1-p**i) * p return res N, M = map(int, raw_input().split()) p = float(raw_input()) res = f(N, M, p) print res