import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanner=new Scanner(System.in);
		long a=scanner.nextLong();
		long b=scanner.nextLong();
		long x=scanner.nextLong();
		long count=0;
//		这里需要注意,是至少购买到x只,可以超的
		if(x>=3) {
			if(b/3.0<a) {
				if(a<b) {
					if(x%3==0) {
						count+=x/3*b;
					}else {
						count+=x/3*b+(x%3)*a;
					}
					
				}else {
					if(x%3==0) {
						count+=x/3*b;
					}else {
						count+=x/3*b+b;
					}
				}
				
			}else {
				count+=x*a;
			}
		}else {
			if(x*a>b) {
				count+=b;
				
			}else {
				count+=x*a;
			}
		}
		System.out.println(count);

	}

}

这一题还是挺坑的,没想到情况这么多种,有的时候买三只一起买比只买一只还便宜。还有就是要注意是否能整除,只有无法整除的时候才需要看情况补充a。然后就是这题说的x是指至少要x只,可以超过,也就是说,可以为了便宜多买几只。最后,还是得注意,这里用到了x*b,如果使用int会超范围,需要开long