h,w=map(int,input().split()) p=float(input()) ans = 0 t1 = max(h-2,0) * max(w-2,0) * (p**5) t2 = 0 if w >= 2: if h == 1: t2 += (w - 2) * (p ** 3) else: t2 += (w - 2) * 2 * (p**4) if h >= 2: if w == 1: t2 += (h - 2) * (p ** 3) else: t2 += (h - 2) * 2 * (p**4) if h >= 2 and w >= 2: t3 = 4 * (p**3) elif h < 2 and w < 2: t3 = p else: t3 = 2 * (p**2) print(t1 + t2 + t3)