#!/usr/bin/python2 # -*- coding: utf-8 -*- # † from decimal import Decimal from fractions import Fraction as frac 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 def conv(fra): a, b = fra.numerator, fra.denominator integer, rem = divmod(a, b) v = [] while True: if rem == 0: break rem *= 10 quo, rem = divmod(rem, b) v.append(quo) res = '{}.{}'.format(integer, ''.join(map(str, v))) res = res.rstrip('0') if res.endswith('.'): res = res[:-1] return res N, M = map(int, raw_input().split()) p = frac(Decimal(raw_input())) res = f(N, M, p) print conv(res)