N, M = gets.split.map(&:to_i) P = gets.to_f ans = 0 if N == 1 && M == 1 puts P exit end if N == 1 ans += 2 * P ** 2 ans += [0, (M - 2)].max * P ** 3 elsif M == 1 ans += 2 * P ** 2 ans += [0, (N - 2)].max * P ** 3 else ans += 4 * P ** 3 ans += 2 * [0, (N - 2)].max * P ** 4 ans += 2 * [0, (M - 2)].max * P ** 4 ans += [0, (N - 2)].max * [0, (M - 2)].max * P ** 5 end puts ans