using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (h, w) = (c[0], c[1]); var p = double.Parse(ReadLine()); if (h > w) (h, w) = (w, h); if (w == 1) WriteLine(p); else if (h == 1) WriteLine(2 * p * p + (w - 2) * p * p * p); else WriteLine(4 * p * p * p + (h + w - 4) * 2 * p * p * p * p + (h - 2) * (w - 2) * p * p * p * p * p); } }