import java.util.Scanner; class no586{ public static void main(String[] args) { Scanner stdIn=new Scanner(System.in); int p1=stdIn.nextInt(),p2=stdIn.nextInt(),n=stdIn.nextInt(),r,a[]=new int[999],i,s=0; for(i=0;i0)s+=a[i]-1; System.out.print((p1+p2)*s); } }