# Enter your code here. Read input from STDIN. Print output to STDOUT a, b, t = map(int, raw_input().split()) k = 0.5*a*t+0.5*b*t print(int(k%(1000000000 + 7)))