import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner in=new Scanner(System.in); int a,b,t; a=in.nextInt(); b=in.nextInt(); t=in.nextInt(); double k=Math.pow(10.0, 9)+7.0; double res=((0.5*((double)a)*((double)t))+(0.5*((double)b)*((double)t)))%k; System.out.println((int)res); } }