import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int aPrice = sc.nextInt();
		int bPrice = sc.nextInt();
		int abPrice = sc.nextInt();
		int aPizzaCnt = sc.nextInt();
		int bPizzaCnt = sc.nextInt();
		sc.close();
		int abPizzaCnt = (aPizzaCnt > bPizzaCnt)? aPizzaCnt*2:bPizzaCnt*2;
		int defaultPrice = (aPrice*aPizzaCnt) + (bPrice*bPizzaCnt);
		int gattaiPrice = abPizzaCnt * abPrice;
		int sabunPrice = (((aPizzaCnt > bPizzaCnt)? bPizzaCnt*2:aPizzaCnt*2) * abPrice)
				+ ((aPizzaCnt > bPizzaCnt)? (aPizzaCnt-bPizzaCnt)*aPrice:
					(bPizzaCnt-aPizzaCnt)*bPrice);
		if(gattaiPrice > sabunPrice) gattaiPrice = sabunPrice;
		System.out.println((defaultPrice > gattaiPrice)?gattaiPrice:defaultPrice);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int aPrice = sc.nextInt();
		int bPrice = sc.nextInt();
		int abPrice = sc.nextInt();
		int aPizzaCnt = sc.nextInt();
		int bPizzaCnt = sc.nextInt();
		sc.close();
		int abPizzaCnt = (aPizzaCnt > bPizzaCnt)? aPizzaCnt*2:bPizzaCnt*2;
		int defaultPrice = (aPrice*aPizzaCnt) + (bPrice*bPizzaCnt);
		int gattaiPrice = abPizzaCnt * abPrice;
		int sabunPrice = (((aPizzaCnt > bPizzaCnt)? bPizzaCnt*2:aPizzaCnt*2) * abPrice)
				+ ((aPizzaCnt > bPizzaCnt)? (aPizzaCnt-bPizzaCnt)*aPrice:
					(bPizzaCnt-aPizzaCnt)*bPrice);
		if(gattaiPrice > sabunPrice) gattaiPrice = sabunPrice;
		System.out.println((defaultPrice > gattaiPrice)?gattaiPrice:defaultPrice);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int aPrice = sc.nextInt();
		int bPrice = sc.nextInt();
		int abPrice = sc.nextInt();
		int aPizzaCnt = sc.nextInt();
		int bPizzaCnt = sc.nextInt();
		sc.close();
		int abPizzaCnt = (aPizzaCnt > bPizzaCnt)? aPizzaCnt*2:bPizzaCnt*2;
		int defaultPrice = (aPrice*aPizzaCnt) + (bPrice*bPizzaCnt);
		int gattaiPrice = abPizzaCnt * abPrice;
		int sabunPrice = (((aPizzaCnt > bPizzaCnt)? bPizzaCnt*2:aPizzaCnt*2) * abPrice)
				+ ((aPizzaCnt > bPizzaCnt)? (aPizzaCnt-bPizzaCnt)*aPrice:
					(bPizzaCnt-aPizzaCnt)*bPrice);
		if(gattaiPrice > sabunPrice) gattaiPrice = sabunPrice;
		System.out.println((defaultPrice > gattaiPrice)?gattaiPrice:defaultPrice);
	} main {
		Scanner sc = new Scanner(System.in);
		int aPrice = sc.nextInt();
		int bPrice = sc.nextInt();
		int abPrice = sc.nextInt();
		int aPizzaCnt = sc.nextInt();
		int bPizzaCnt = sc.nextInt();
		sc.close();
		int abPizzaCnt = (aPizzaCnt > bPizzaCnt)? aPizzaCnt*2:bPizzaCnt*2;
		int defaultPrice = (aPrice*aPizzaCnt) + (bPrice*bPizzaCnt);
		int gattaiPrice = abPizzaCnt * abPrice;
		int sabunPrice = (((aPizzaCnt > bPizzaCnt)? bPizzaCnt*2:aPizzaCnt*2) * abPrice)
				+ ((aPizzaCnt > bPizzaCnt)? (aPizzaCnt-bPizzaCnt)*aPrice:
					(bPizzaCnt-aPizzaCnt)*bPrice);
		if(gattaiPrice > sabunPrice) gattaiPrice = sabunPrice;
		System.out.println((defaultPrice > gattaiPrice)?gattaiPrice:defaultPrice);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int aPrice = sc.nextInt(); aPrice sc.nextInt() sc.nextInt sc int bPrice = sc.nextInt(); bPrice sc.nextInt() sc.nextInt sc int abPrice = sc.nextInt(); abPrice sc.nextInt() sc.nextInt sc int aPizzaCnt = sc.nextInt(); aPizzaCnt sc.nextInt() sc.nextInt sc int bPizzaCnt = sc.nextInt(); bPizzaCnt sc.nextInt() sc.nextInt sc sc.close() sc.close sc int abPizzaCnt = (aPizzaCnt > bPizzaCnt)? aPizzaCnt*2:bPizzaCnt*2; abPizzaCnt (aPizzaCnt > bPizzaCnt)? aPizzaCnt*2:bPizzaCnt*2 (aPizzaCnt > bPizzaCnt) aPizzaCnt bPizzaCnt aPizzaCnt*2 aPizzaCnt 2 bPizzaCnt*2 bPizzaCnt 2 int defaultPrice = (aPrice*aPizzaCnt) + (bPrice*bPizzaCnt); defaultPrice (aPrice*aPizzaCnt) + (bPrice*bPizzaCnt) (aPrice*aPizzaCnt) aPrice aPizzaCnt (bPrice*bPizzaCnt) bPrice bPizzaCnt int gattaiPrice = abPizzaCnt * abPrice; gattaiPrice abPizzaCnt * abPrice abPizzaCnt abPrice int sabunPrice = (((aPizzaCnt > bPizzaCnt)? bPizzaCnt*2:aPizzaCnt*2) * abPrice)
				+ ((aPizzaCnt > bPizzaCnt)? (aPizzaCnt-bPizzaCnt)*aPrice:
					(bPizzaCnt-aPizzaCnt)*bPrice); sabunPrice (((aPizzaCnt > bPizzaCnt)? bPizzaCnt*2:aPizzaCnt*2) * abPrice)
				+ ((aPizzaCnt > bPizzaCnt)? (aPizzaCnt-bPizzaCnt)*aPrice:
					(bPizzaCnt-aPizzaCnt)*bPrice) (((aPizzaCnt > bPizzaCnt)? bPizzaCnt*2:aPizzaCnt*2) * abPrice) ((aPizzaCnt > bPizzaCnt)? bPizzaCnt*2:aPizzaCnt*2) (aPizzaCnt > bPizzaCnt) aPizzaCnt bPizzaCnt bPizzaCnt*2 bPizzaCnt 2 aPizzaCnt*2 aPizzaCnt 2 abPrice ((aPizzaCnt > bPizzaCnt)? (aPizzaCnt-bPizzaCnt)*aPrice:
					(bPizzaCnt-aPizzaCnt)*bPrice) (aPizzaCnt > bPizzaCnt) aPizzaCnt bPizzaCnt (aPizzaCnt-bPizzaCnt)*aPrice (aPizzaCnt-bPizzaCnt) aPizzaCnt bPizzaCnt aPrice (bPizzaCnt-aPizzaCnt)*bPrice (bPizzaCnt-aPizzaCnt) bPizzaCnt aPizzaCnt bPrice if(gattaiPrice > sabunPrice) gattaiPrice = sabunPrice; gattaiPrice > sabunPrice gattaiPrice sabunPrice gattaiPrice = sabunPrice gattaiPrice sabunPrice System.out.println((defaultPrice > gattaiPrice)?gattaiPrice:defaultPrice) System.out.println System.out System System.out (defaultPrice > gattaiPrice)?gattaiPrice:defaultPrice (defaultPrice > gattaiPrice) defaultPrice gattaiPrice gattaiPrice defaultPrice String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int aPrice = sc.nextInt();
		int bPrice = sc.nextInt();
		int abPrice = sc.nextInt();
		int aPizzaCnt = sc.nextInt();
		int bPizzaCnt = sc.nextInt();
		sc.close();
		int abPizzaCnt = (aPizzaCnt > bPizzaCnt)? aPizzaCnt*2:bPizzaCnt*2;
		int defaultPrice = (aPrice*aPizzaCnt) + (bPrice*bPizzaCnt);
		int gattaiPrice = abPizzaCnt * abPrice;
		int sabunPrice = (((aPizzaCnt > bPizzaCnt)? bPizzaCnt*2:aPizzaCnt*2) * abPrice)
				+ ((aPizzaCnt > bPizzaCnt)? (aPizzaCnt-bPizzaCnt)*aPrice:
					(bPizzaCnt-aPizzaCnt)*bPrice);
		if(gattaiPrice > sabunPrice) gattaiPrice = sabunPrice;
		System.out.println((defaultPrice > gattaiPrice)?gattaiPrice:defaultPrice);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int aPrice = sc.nextInt();
		int bPrice = sc.nextInt();
		int abPrice = sc.nextInt();
		int aPizzaCnt = sc.nextInt();
		int bPizzaCnt = sc.nextInt();
		sc.close();
		int abPizzaCnt = (aPizzaCnt > bPizzaCnt)? aPizzaCnt*2:bPizzaCnt*2;
		int defaultPrice = (aPrice*aPizzaCnt) + (bPrice*bPizzaCnt);
		int gattaiPrice = abPizzaCnt * abPrice;
		int sabunPrice = (((aPizzaCnt > bPizzaCnt)? bPizzaCnt*2:aPizzaCnt*2) * abPrice)
				+ ((aPizzaCnt > bPizzaCnt)? (aPizzaCnt-bPizzaCnt)*aPrice:
					(bPizzaCnt-aPizzaCnt)*bPrice);
		if(gattaiPrice > sabunPrice) gattaiPrice = sabunPrice;
		System.out.println((defaultPrice > gattaiPrice)?gattaiPrice:defaultPrice);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int aPrice = sc.nextInt();
		int bPrice = sc.nextInt();
		int abPrice = sc.nextInt();
		int aPizzaCnt = sc.nextInt();
		int bPizzaCnt = sc.nextInt();
		sc.close();
		int abPizzaCnt = (aPizzaCnt > bPizzaCnt)? aPizzaCnt*2:bPizzaCnt*2;
		int defaultPrice = (aPrice*aPizzaCnt) + (bPrice*bPizzaCnt);
		int gattaiPrice = abPizzaCnt * abPrice;
		int sabunPrice = (((aPizzaCnt > bPizzaCnt)? bPizzaCnt*2:aPizzaCnt*2) * abPrice)
				+ ((aPizzaCnt > bPizzaCnt)? (aPizzaCnt-bPizzaCnt)*aPrice:
					(bPizzaCnt-aPizzaCnt)*bPrice);
		if(gattaiPrice > sabunPrice) gattaiPrice = sabunPrice;
		System.out.println((defaultPrice > gattaiPrice)?gattaiPrice:defaultPrice);
	}
}