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. */ long a,b; double n,n1; long t; Scanner scan=new Scanner(System.in); a=scan.nextLong(); b=scan.nextLong(); t=scan.nextLong(); n=((0.5*a*t)+(0.5*b*t)); n1=n%(Math.pow(10,9)+7); /* long t1=Math.pow(10,9)+7; BigInteger bi1, bi2, bi3; bi1 = new BigInteger(n); bi2 = new BigInteger(t1); // perform mod operation on bi1 using bi2 bi3 = bi1.mod(bi2); //Double obj = new Double(n1); //int i = obj.intValue();*/ System.out.print(Math.round(n1)); //System.out.print(bi3); } }