import java.util.*;

public class Main {

	static class Pizza {
		int num;
		int money;

		Pizza(int n, int m) {
			this.num = n;
			this.money = m;
		}

		int getnum() {
			return num;
		}

		int getmoney() {
			return money;
		}
	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

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

		int X = sc.nextInt();
		int Y = sc.nextInt();

		int A_B = A + B;

		Pizza p_B;
		Pizza p_S;

		if (X > Y) {
			p_B = new Pizza(X, A);
			p_S = new Pizza(Y, B);
		} else {
			p_S = new Pizza(X, A);
			p_B = new Pizza(Y, B);
		}

		int ans = 0;
		if (A_B > C * 2) {
			ans = C * p_S.getnum() * 2;
		} else {
			ans = A_B * p_S.getnum();
		}

		int n = p_B.getnum() - p_S.getnum();

		if (p_B.getmoney() > C * 2) {
			ans = ans + n * C * 2;
		} else {
			ans = ans + n * p_B.getmoney();
		}

		System.out.println(ans);
		sc.close();

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

	static class Pizza {
		int num;
		int money;

		Pizza(int n, int m) {
			this.num = n;
			this.money = m;
		}

		int getnum() {
			return num;
		}

		int getmoney() {
			return money;
		}
	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

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

		int X = sc.nextInt();
		int Y = sc.nextInt();

		int A_B = A + B;

		Pizza p_B;
		Pizza p_S;

		if (X > Y) {
			p_B = new Pizza(X, A);
			p_S = new Pizza(Y, B);
		} else {
			p_S = new Pizza(X, A);
			p_B = new Pizza(Y, B);
		}

		int ans = 0;
		if (A_B > C * 2) {
			ans = C * p_S.getnum() * 2;
		} else {
			ans = A_B * p_S.getnum();
		}

		int n = p_B.getnum() - p_S.getnum();

		if (p_B.getmoney() > C * 2) {
			ans = ans + n * C * 2;
		} else {
			ans = ans + n * p_B.getmoney();
		}

		System.out.println(ans);
		sc.close();

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

		Scanner sc = new Scanner(System.in);

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

		int X = sc.nextInt();
		int Y = sc.nextInt();

		int A_B = A + B;

		Pizza p_B;
		Pizza p_S;

		if (X > Y) {
			p_B = new Pizza(X, A);
			p_S = new Pizza(Y, B);
		} else {
			p_S = new Pizza(X, A);
			p_B = new Pizza(Y, B);
		}

		int ans = 0;
		if (A_B > C * 2) {
			ans = C * p_S.getnum() * 2;
		} else {
			ans = A_B * p_S.getnum();
		}

		int n = p_B.getnum() - p_S.getnum();

		if (p_B.getmoney() > C * 2) {
			ans = ans + n * C * 2;
		} else {
			ans = ans + n * p_B.getmoney();
		}

		System.out.println(ans);
		sc.close();

	} main {

		Scanner sc = new Scanner(System.in);

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

		int X = sc.nextInt();
		int Y = sc.nextInt();

		int A_B = A + B;

		Pizza p_B;
		Pizza p_S;

		if (X > Y) {
			p_B = new Pizza(X, A);
			p_S = new Pizza(Y, B);
		} else {
			p_S = new Pizza(X, A);
			p_B = new Pizza(Y, B);
		}

		int ans = 0;
		if (A_B > C * 2) {
			ans = C * p_S.getnum() * 2;
		} else {
			ans = A_B * p_S.getnum();
		}

		int n = p_B.getnum() - p_S.getnum();

		if (p_B.getmoney() > C * 2) {
			ans = ans + n * C * 2;
		} else {
			ans = ans + n * p_B.getmoney();
		}

		System.out.println(ans);
		sc.close();

	} 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 A_B = A + B; A_B A + B A B Pizza p_B; p_B Pizza p_S; p_S if (X > Y) {
			p_B = new Pizza(X, A);
			p_S = new Pizza(Y, B);
		} else {
			p_S = new Pizza(X, A);
			p_B = new Pizza(Y, B);
		} X > Y X Y {
			p_B = new Pizza(X, A);
			p_S = new Pizza(Y, B);
		} p_B = new Pizza(X, A) p_B new Pizza(X, A) p_S = new Pizza(Y, B) p_S new Pizza(Y, B) {
			p_S = new Pizza(X, A);
			p_B = new Pizza(Y, B);
		} p_S = new Pizza(X, A) p_S new Pizza(X, A) p_B = new Pizza(Y, B) p_B new Pizza(Y, B) int ans = 0; ans 0 if (A_B > C * 2) {
			ans = C * p_S.getnum() * 2;
		} else {
			ans = A_B * p_S.getnum();
		} A_B > C * 2 A_B C * 2 C 2 {
			ans = C * p_S.getnum() * 2;
		} ans = C * p_S.getnum() * 2 ans C * p_S.getnum() * 2 C * p_S.getnum() * 2 C p_S.getnum() p_S.getnum p_S 2 {
			ans = A_B * p_S.getnum();
		} ans = A_B * p_S.getnum() ans A_B * p_S.getnum() A_B p_S.getnum() p_S.getnum p_S int n = p_B.getnum() - p_S.getnum(); n p_B.getnum() - p_S.getnum() p_B.getnum() p_B.getnum p_B p_S.getnum() p_S.getnum p_S if (p_B.getmoney() > C * 2) {
			ans = ans + n * C * 2;
		} else {
			ans = ans + n * p_B.getmoney();
		} p_B.getmoney() > C * 2 p_B.getmoney() p_B.getmoney p_B C * 2 C 2 {
			ans = ans + n * C * 2;
		} ans = ans + n * C * 2 ans ans + n * C * 2 ans n * C * 2 n * C * 2 n C 2 {
			ans = ans + n * p_B.getmoney();
		} ans = ans + n * p_B.getmoney() ans ans + n * p_B.getmoney() ans n * p_B.getmoney() n p_B.getmoney() p_B.getmoney p_B System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args static class Pizza {
		int num;
		int money;

		Pizza(int n, int m) {
			this.num = n;
			this.money = m;
		}

		int getnum() {
			return num;
		}

		int getmoney() {
			return money;
		}
	} Pizza int num; num int money; money Pizza(int n, int m) {
			this.num = n;
			this.money = m;
		} Pizza {
			this.num = n;
			this.money = m;
		} this.num = n this.num this this.num n this.money = m this.money this this.money m int n n int m m int getnum() {
			return num;
		} getnum {
			return num;
		} return num; num int getmoney() {
			return money;
		} getmoney {
			return money;
		} return money; money public class Main {

	static class Pizza {
		int num;
		int money;

		Pizza(int n, int m) {
			this.num = n;
			this.money = m;
		}

		int getnum() {
			return num;
		}

		int getmoney() {
			return money;
		}
	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

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

		int X = sc.nextInt();
		int Y = sc.nextInt();

		int A_B = A + B;

		Pizza p_B;
		Pizza p_S;

		if (X > Y) {
			p_B = new Pizza(X, A);
			p_S = new Pizza(Y, B);
		} else {
			p_S = new Pizza(X, A);
			p_B = new Pizza(Y, B);
		}

		int ans = 0;
		if (A_B > C * 2) {
			ans = C * p_S.getnum() * 2;
		} else {
			ans = A_B * p_S.getnum();
		}

		int n = p_B.getnum() - p_S.getnum();

		if (p_B.getmoney() > C * 2) {
			ans = ans + n * C * 2;
		} else {
			ans = ans + n * p_B.getmoney();
		}

		System.out.println(ans);
		sc.close();

	}
} public class Main {

	static class Pizza {
		int num;
		int money;

		Pizza(int n, int m) {
			this.num = n;
			this.money = m;
		}

		int getnum() {
			return num;
		}

		int getmoney() {
			return money;
		}
	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

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

		int X = sc.nextInt();
		int Y = sc.nextInt();

		int A_B = A + B;

		Pizza p_B;
		Pizza p_S;

		if (X > Y) {
			p_B = new Pizza(X, A);
			p_S = new Pizza(Y, B);
		} else {
			p_S = new Pizza(X, A);
			p_B = new Pizza(Y, B);
		}

		int ans = 0;
		if (A_B > C * 2) {
			ans = C * p_S.getnum() * 2;
		} else {
			ans = A_B * p_S.getnum();
		}

		int n = p_B.getnum() - p_S.getnum();

		if (p_B.getmoney() > C * 2) {
			ans = ans + n * C * 2;
		} else {
			ans = ans + n * p_B.getmoney();
		}

		System.out.println(ans);
		sc.close();

	}
} Main
import java.util.*;

public class Main {

	static class Pizza {
		int num;
		int money;

		Pizza(int n, int m) {
			this.num = n;
			this.money = m;
		}

		int getnum() {
			return num;
		}

		int getmoney() {
			return money;
		}
	}

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

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

		int X = sc.nextInt();
		int Y = sc.nextInt();

		int A_B = A + B;

		Pizza p_B;
		Pizza p_S;

		if (X > Y) {
			p_B = new Pizza(X, A);
			p_S = new Pizza(Y, B);
		} else {
			p_S = new Pizza(X, A);
			p_B = new Pizza(Y, B);
		}

		int ans = 0;
		if (A_B > C * 2) {
			ans = C * p_S.getnum() * 2;
		} else {
			ans = A_B * p_S.getnum();
		}

		int n = p_B.getnum() - p_S.getnum();

		if (p_B.getmoney() > C * 2) {
			ans = ans + n * C * 2;
		} else {
			ans = ans + n * p_B.getmoney();
		}

		System.out.println(ans);
		sc.close();

	}
}
