import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def MI(): return map(int, sys.stdin.readline().split()) def MF(): return map(float, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LF(): return list(map(float, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def main(): n,m=MI() p = float(input()) if n1: cp=p**3 ep=p**4 ip=p**5 ans=cp*4+ep*2*(n+m-4)+ip*(n-2)*(m-2) else: cp=p**2 ep=p**3 ans=cp*2+ep*(n-2) print(ans) main()