import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner s=new Scanner(System.in); int a=s.nextInt(); int b=s.nextInt(); int t=s.nextInt(); double temp=a*0.5*t+ b*0.5*t; temp=temp%1000000007; System.out.println(Math.round(temp)); } }