import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		int price;

		if (A+B < 2*C){
			price = A*X + B*Y;
		} else {
			int ACnt=0;
			int BCnt=0;
			int CCnt=0;
			CCnt = 2 * Math.min(X, Y);
			int remainA = X - CCnt/2;
			int remainB = Y - CCnt/2;
			if (remainA > 0){
				if (A >= 2*C){
					CCnt += remainA * 2;
				} else {
					ACnt += remainA;
				}
			} else {
				if (B >= 2*C){
					CCnt += remainB * 2;
				} else {
					BCnt += remainB;
				}
			}
			price = A * ACnt + B * BCnt + C*CCnt;
		}
		System.out.println(price);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		int price;

		if (A+B < 2*C){
			price = A*X + B*Y;
		} else {
			int ACnt=0;
			int BCnt=0;
			int CCnt=0;
			CCnt = 2 * Math.min(X, Y);
			int remainA = X - CCnt/2;
			int remainB = Y - CCnt/2;
			if (remainA > 0){
				if (A >= 2*C){
					CCnt += remainA * 2;
				} else {
					ACnt += remainA;
				}
			} else {
				if (B >= 2*C){
					CCnt += remainB * 2;
				} else {
					BCnt += remainB;
				}
			}
			price = A * ACnt + B * BCnt + C*CCnt;
		}
		System.out.println(price);
	}

} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		int price;

		if (A+B < 2*C){
			price = A*X + B*Y;
		} else {
			int ACnt=0;
			int BCnt=0;
			int CCnt=0;
			CCnt = 2 * Math.min(X, Y);
			int remainA = X - CCnt/2;
			int remainB = Y - CCnt/2;
			if (remainA > 0){
				if (A >= 2*C){
					CCnt += remainA * 2;
				} else {
					ACnt += remainA;
				}
			} else {
				if (B >= 2*C){
					CCnt += remainB * 2;
				} else {
					BCnt += remainB;
				}
			}
			price = A * ACnt + B * BCnt + C*CCnt;
		}
		System.out.println(price);
	} main {

		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		int price;

		if (A+B < 2*C){
			price = A*X + B*Y;
		} else {
			int ACnt=0;
			int BCnt=0;
			int CCnt=0;
			CCnt = 2 * Math.min(X, Y);
			int remainA = X - CCnt/2;
			int remainB = Y - CCnt/2;
			if (remainA > 0){
				if (A >= 2*C){
					CCnt += remainA * 2;
				} else {
					ACnt += remainA;
				}
			} else {
				if (B >= 2*C){
					CCnt += remainB * 2;
				} else {
					BCnt += remainB;
				}
			}
			price = A * ACnt + B * BCnt + C*CCnt;
		}
		System.out.println(price);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int C = sc.nextInt(); C sc.nextInt() sc.nextInt sc int X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int Y = sc.nextInt(); Y sc.nextInt() sc.nextInt sc int price; price if (A+B < 2*C){
			price = A*X + B*Y;
		} else {
			int ACnt=0;
			int BCnt=0;
			int CCnt=0;
			CCnt = 2 * Math.min(X, Y);
			int remainA = X - CCnt/2;
			int remainB = Y - CCnt/2;
			if (remainA > 0){
				if (A >= 2*C){
					CCnt += remainA * 2;
				} else {
					ACnt += remainA;
				}
			} else {
				if (B >= 2*C){
					CCnt += remainB * 2;
				} else {
					BCnt += remainB;
				}
			}
			price = A * ACnt + B * BCnt + C*CCnt;
		} A+B < 2*C A+B A B 2*C 2 C {
			price = A*X + B*Y;
		} price = A*X + B*Y price A*X + B*Y A*X A X B*Y B Y {
			int ACnt=0;
			int BCnt=0;
			int CCnt=0;
			CCnt = 2 * Math.min(X, Y);
			int remainA = X - CCnt/2;
			int remainB = Y - CCnt/2;
			if (remainA > 0){
				if (A >= 2*C){
					CCnt += remainA * 2;
				} else {
					ACnt += remainA;
				}
			} else {
				if (B >= 2*C){
					CCnt += remainB * 2;
				} else {
					BCnt += remainB;
				}
			}
			price = A * ACnt + B * BCnt + C*CCnt;
		} int ACnt=0; ACnt 0 int BCnt=0; BCnt 0 int CCnt=0; CCnt 0 CCnt = 2 * Math.min(X, Y) CCnt 2 * Math.min(X, Y) 2 Math.min(X, Y) Math.min Math X Y int remainA = X - CCnt/2; remainA X - CCnt/2 X CCnt/2 CCnt 2 int remainB = Y - CCnt/2; remainB Y - CCnt/2 Y CCnt/2 CCnt 2 if (remainA > 0){
				if (A >= 2*C){
					CCnt += remainA * 2;
				} else {
					ACnt += remainA;
				}
			} else {
				if (B >= 2*C){
					CCnt += remainB * 2;
				} else {
					BCnt += remainB;
				}
			} remainA > 0 remainA 0 {
				if (A >= 2*C){
					CCnt += remainA * 2;
				} else {
					ACnt += remainA;
				}
			} if (A >= 2*C){
					CCnt += remainA * 2;
				} else {
					ACnt += remainA;
				} A >= 2*C A 2*C 2 C {
					CCnt += remainA * 2;
				} CCnt += remainA * 2 CCnt remainA * 2 remainA 2 {
					ACnt += remainA;
				} ACnt += remainA ACnt remainA {
				if (B >= 2*C){
					CCnt += remainB * 2;
				} else {
					BCnt += remainB;
				}
			} if (B >= 2*C){
					CCnt += remainB * 2;
				} else {
					BCnt += remainB;
				} B >= 2*C B 2*C 2 C {
					CCnt += remainB * 2;
				} CCnt += remainB * 2 CCnt remainB * 2 remainB 2 {
					BCnt += remainB;
				} BCnt += remainB BCnt remainB price = A * ACnt + B * BCnt + C*CCnt price A * ACnt + B * BCnt + C*CCnt A * ACnt + B * BCnt + C*CCnt A * ACnt A ACnt B * BCnt B BCnt C*CCnt C CCnt System.out.println(price) System.out.println System.out System System.out price String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		int price;

		if (A+B < 2*C){
			price = A*X + B*Y;
		} else {
			int ACnt=0;
			int BCnt=0;
			int CCnt=0;
			CCnt = 2 * Math.min(X, Y);
			int remainA = X - CCnt/2;
			int remainB = Y - CCnt/2;
			if (remainA > 0){
				if (A >= 2*C){
					CCnt += remainA * 2;
				} else {
					ACnt += remainA;
				}
			} else {
				if (B >= 2*C){
					CCnt += remainB * 2;
				} else {
					BCnt += remainB;
				}
			}
			price = A * ACnt + B * BCnt + C*CCnt;
		}
		System.out.println(price);
	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		int price;

		if (A+B < 2*C){
			price = A*X + B*Y;
		} else {
			int ACnt=0;
			int BCnt=0;
			int CCnt=0;
			CCnt = 2 * Math.min(X, Y);
			int remainA = X - CCnt/2;
			int remainB = Y - CCnt/2;
			if (remainA > 0){
				if (A >= 2*C){
					CCnt += remainA * 2;
				} else {
					ACnt += remainA;
				}
			} else {
				if (B >= 2*C){
					CCnt += remainB * 2;
				} else {
					BCnt += remainB;
				}
			}
			price = A * ACnt + B * BCnt + C*CCnt;
		}
		System.out.println(price);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		int price;

		if (A+B < 2*C){
			price = A*X + B*Y;
		} else {
			int ACnt=0;
			int BCnt=0;
			int CCnt=0;
			CCnt = 2 * Math.min(X, Y);
			int remainA = X - CCnt/2;
			int remainB = Y - CCnt/2;
			if (remainA > 0){
				if (A >= 2*C){
					CCnt += remainA * 2;
				} else {
					ACnt += remainA;
				}
			} else {
				if (B >= 2*C){
					CCnt += remainB * 2;
				} else {
					BCnt += remainB;
				}
			}
			price = A * ACnt + B * BCnt + C*CCnt;
		}
		System.out.println(price);
	}

}
