N, M = map(int, input().split()) P = float(input()) x_corner = 3 if M == 1: x_corner -= 1 if N == 1: x_corner -= 1 x_ud = 4 if N < 2: x_ud -= 1 x_lr = 4 if M < 2: x_lr -= 1 x_inner = 5 corner = 4 if N == M == 1: corner = 1 if N == 1 or M == 1: corner = 2 ud = max(0, 2 * (M - 2)) lr = max(0, 2 * (N - 2)) inner = max(0, M - 2) * max(0, N - 2) ans = corner * P**x_corner + ud * P**x_ud + lr * P**x_lr + inner * P**x_inner print(ans)