#!/Users/takaesumizuki/anaconda3/envs/hoge/bin/python def main(): A, B = map(int, input().split()) P = float(input()) if A > B : A, B = B, A if A == 1 and B == 1: print(P) return if A == 1: ans = (B - 2) * (P ** 3) + 2 * (P ** 2) print(ans) return ans = 4 * (P ** 3) + (A + B - 4) * 2 * (P ** 4) + (A - 2) * (B - 2) * (P ** 5) print(ans) return if __name__ == '__main__': main()