a, b, t = [int(x) for x in input().split()] num = (0.5 * a * t) + (0.5 * b * t) print(int(num % (10**9 + 7)))