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 aHituyoSu = sc.nextInt();
		int bHituyoSu = sc.nextInt();
		int normalPrice = (aPrice * aHituyoSu) + (bPrice * bHituyoSu);
		int small= 0;
		int big= 0;
		boolean aBigFlg = false;
		if(aHituyoSu < bHituyoSu) {
			big = bHituyoSu;
			small = aHituyoSu;
		}else {
			big = aHituyoSu;
			small = bHituyoSu;
			aBigFlg = true;
		}
		int answer = normalPrice;
		for(int i =1;i <=big;i++) {
			int price = 0;
			if(i <= small) {
				price = normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i);
			}else {
				if(aBigFlg) {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				}else {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				}
			}
			if(answer >price) {
				answer = price;
			}

		}

		System.out.println(answer);

	}
} 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 aHituyoSu = sc.nextInt();
		int bHituyoSu = sc.nextInt();
		int normalPrice = (aPrice * aHituyoSu) + (bPrice * bHituyoSu);
		int small= 0;
		int big= 0;
		boolean aBigFlg = false;
		if(aHituyoSu < bHituyoSu) {
			big = bHituyoSu;
			small = aHituyoSu;
		}else {
			big = aHituyoSu;
			small = bHituyoSu;
			aBigFlg = true;
		}
		int answer = normalPrice;
		for(int i =1;i <=big;i++) {
			int price = 0;
			if(i <= small) {
				price = normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i);
			}else {
				if(aBigFlg) {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				}else {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				}
			}
			if(answer >price) {
				answer = price;
			}

		}

		System.out.println(answer);

	}
} 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 aHituyoSu = sc.nextInt();
		int bHituyoSu = sc.nextInt();
		int normalPrice = (aPrice * aHituyoSu) + (bPrice * bHituyoSu);
		int small= 0;
		int big= 0;
		boolean aBigFlg = false;
		if(aHituyoSu < bHituyoSu) {
			big = bHituyoSu;
			small = aHituyoSu;
		}else {
			big = aHituyoSu;
			small = bHituyoSu;
			aBigFlg = true;
		}
		int answer = normalPrice;
		for(int i =1;i <=big;i++) {
			int price = 0;
			if(i <= small) {
				price = normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i);
			}else {
				if(aBigFlg) {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				}else {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				}
			}
			if(answer >price) {
				answer = price;
			}

		}

		System.out.println(answer);

	} main {
		Scanner sc = new Scanner(System.in);
		int aPrice  = sc.nextInt();
		int bPrice  = sc.nextInt();
		int abPrice  = sc.nextInt();
		int aHituyoSu = sc.nextInt();
		int bHituyoSu = sc.nextInt();
		int normalPrice = (aPrice * aHituyoSu) + (bPrice * bHituyoSu);
		int small= 0;
		int big= 0;
		boolean aBigFlg = false;
		if(aHituyoSu < bHituyoSu) {
			big = bHituyoSu;
			small = aHituyoSu;
		}else {
			big = aHituyoSu;
			small = bHituyoSu;
			aBigFlg = true;
		}
		int answer = normalPrice;
		for(int i =1;i <=big;i++) {
			int price = 0;
			if(i <= small) {
				price = normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i);
			}else {
				if(aBigFlg) {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				}else {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				}
			}
			if(answer >price) {
				answer = price;
			}

		}

		System.out.println(answer);

	} 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 aHituyoSu = sc.nextInt(); aHituyoSu sc.nextInt() sc.nextInt sc int bHituyoSu = sc.nextInt(); bHituyoSu sc.nextInt() sc.nextInt sc int normalPrice = (aPrice * aHituyoSu) + (bPrice * bHituyoSu); normalPrice (aPrice * aHituyoSu) + (bPrice * bHituyoSu) (aPrice * aHituyoSu) aPrice aHituyoSu (bPrice * bHituyoSu) bPrice bHituyoSu int small= 0; small 0 int big= 0; big 0 boolean aBigFlg = false; aBigFlg false if(aHituyoSu < bHituyoSu) {
			big = bHituyoSu;
			small = aHituyoSu;
		}else {
			big = aHituyoSu;
			small = bHituyoSu;
			aBigFlg = true;
		} aHituyoSu < bHituyoSu aHituyoSu bHituyoSu {
			big = bHituyoSu;
			small = aHituyoSu;
		} big = bHituyoSu big bHituyoSu small = aHituyoSu small aHituyoSu {
			big = aHituyoSu;
			small = bHituyoSu;
			aBigFlg = true;
		} big = aHituyoSu big aHituyoSu small = bHituyoSu small bHituyoSu aBigFlg = true aBigFlg true int answer = normalPrice; answer normalPrice for(int i =1;i <=big;i++) {
			int price = 0;
			if(i <= small) {
				price = normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i);
			}else {
				if(aBigFlg) {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				}else {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				}
			}
			if(answer >price) {
				answer = price;
			}

		} int i =1; int i =1; i 1 i <=big i big i++ i++ i {
			int price = 0;
			if(i <= small) {
				price = normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i);
			}else {
				if(aBigFlg) {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				}else {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				}
			}
			if(answer >price) {
				answer = price;
			}

		} {
			int price = 0;
			if(i <= small) {
				price = normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i);
			}else {
				if(aBigFlg) {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				}else {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				}
			}
			if(answer >price) {
				answer = price;
			}

		} int price = 0; price 0 if(i <= small) {
				price = normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i);
			}else {
				if(aBigFlg) {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				}else {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				}
			} i <= small i small {
				price = normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i);
			} price = normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i) price normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i) normalPrice -((aPrice +bPrice) * i) normalPrice ((aPrice +bPrice) * i) (aPrice +bPrice) aPrice bPrice i (abPrice* 2 * i) abPrice* 2 * i abPrice 2 i {
				if(aBigFlg) {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				}else {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				}
			} if(aBigFlg) {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				}else {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				} aBigFlg {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				} price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i) price (abPrice* 2 * i) + aPrice * (aHituyoSu -i) (abPrice* 2 * i) abPrice* 2 * i abPrice 2 i aPrice * (aHituyoSu -i) aPrice (aHituyoSu -i) aHituyoSu i {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				} price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i) price (abPrice* 2 * i) + bPrice * (bHituyoSu -i) (abPrice* 2 * i) abPrice* 2 * i abPrice 2 i bPrice * (bHituyoSu -i) bPrice (bHituyoSu -i) bHituyoSu i if(answer >price) {
				answer = price;
			} answer >price answer price {
				answer = price;
			} answer = price answer price System.out.println(answer) System.out.println System.out System System.out answer 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 aHituyoSu = sc.nextInt();
		int bHituyoSu = sc.nextInt();
		int normalPrice = (aPrice * aHituyoSu) + (bPrice * bHituyoSu);
		int small= 0;
		int big= 0;
		boolean aBigFlg = false;
		if(aHituyoSu < bHituyoSu) {
			big = bHituyoSu;
			small = aHituyoSu;
		}else {
			big = aHituyoSu;
			small = bHituyoSu;
			aBigFlg = true;
		}
		int answer = normalPrice;
		for(int i =1;i <=big;i++) {
			int price = 0;
			if(i <= small) {
				price = normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i);
			}else {
				if(aBigFlg) {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				}else {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				}
			}
			if(answer >price) {
				answer = price;
			}

		}

		System.out.println(answer);

	}
} 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 aHituyoSu = sc.nextInt();
		int bHituyoSu = sc.nextInt();
		int normalPrice = (aPrice * aHituyoSu) + (bPrice * bHituyoSu);
		int small= 0;
		int big= 0;
		boolean aBigFlg = false;
		if(aHituyoSu < bHituyoSu) {
			big = bHituyoSu;
			small = aHituyoSu;
		}else {
			big = aHituyoSu;
			small = bHituyoSu;
			aBigFlg = true;
		}
		int answer = normalPrice;
		for(int i =1;i <=big;i++) {
			int price = 0;
			if(i <= small) {
				price = normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i);
			}else {
				if(aBigFlg) {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				}else {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				}
			}
			if(answer >price) {
				answer = price;
			}

		}

		System.out.println(answer);

	}
} 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 aHituyoSu = sc.nextInt();
		int bHituyoSu = sc.nextInt();
		int normalPrice = (aPrice * aHituyoSu) + (bPrice * bHituyoSu);
		int small= 0;
		int big= 0;
		boolean aBigFlg = false;
		if(aHituyoSu < bHituyoSu) {
			big = bHituyoSu;
			small = aHituyoSu;
		}else {
			big = aHituyoSu;
			small = bHituyoSu;
			aBigFlg = true;
		}
		int answer = normalPrice;
		for(int i =1;i <=big;i++) {
			int price = 0;
			if(i <= small) {
				price = normalPrice -((aPrice +bPrice) * i) + (abPrice* 2 * i);
			}else {
				if(aBigFlg) {
					price = (abPrice* 2 * i) + aPrice * (aHituyoSu -i);
				}else {
					price = (abPrice* 2 * i) + bPrice * (bHituyoSu -i);
				}
			}
			if(answer >price) {
				answer = price;
			}

		}

		System.out.println(answer);

	}
}