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: t2 += max(h-2,0) * 2 * (p**4) if h >= 2: t2 += max(w-2,0) * 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)