use std::io::Read; fn run() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).unwrap(); let mut it = s.trim().split_whitespace(); let n: u64 = it.next().unwrap().parse().unwrap(); let m: u64 = it.next().unwrap().parse().unwrap(); let p: f64 = it.next().unwrap().parse().unwrap(); let (h, w) = (std::cmp::min(n, m), std::cmp::max(n, m)); let ans = if w == 1 { p } else if h == 1 { 2.0 * p.powi(2) + (w - 2) as f64 * p.powi(3) } else { 4.0 * p.powi(3) + 2.0 * (h + w - 4) as f64 * p.powi(4) + (h - 2) as f64 * (w - 2) as f64 * p.powi(5) }; println!("{:.8}", ans); } fn main() { run(); }