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 nowX = 0;
		int nowY = 0;
		int min = Integer.MAX_VALUE;
		for (int i = 0; i <= Math.max(2 * x, 2 * y); i += 2) {
			int sum = 0;
			nowX = Math.max(0, x - i / 2);
			nowY = Math.max(0, y - i / 2);
			sum = nowX * a + nowY * b + i * c;
			min = Math.min(min, sum);
		}

		System.out.println(min);

		sc.close();
	}
} 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 nowX = 0;
		int nowY = 0;
		int min = Integer.MAX_VALUE;
		for (int i = 0; i <= Math.max(2 * x, 2 * y); i += 2) {
			int sum = 0;
			nowX = Math.max(0, x - i / 2);
			nowY = Math.max(0, y - i / 2);
			sum = nowX * a + nowY * b + i * c;
			min = Math.min(min, sum);
		}

		System.out.println(min);

		sc.close();
	}
} 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 nowX = 0;
		int nowY = 0;
		int min = Integer.MAX_VALUE;
		for (int i = 0; i <= Math.max(2 * x, 2 * y); i += 2) {
			int sum = 0;
			nowX = Math.max(0, x - i / 2);
			nowY = Math.max(0, y - i / 2);
			sum = nowX * a + nowY * b + i * c;
			min = Math.min(min, sum);
		}

		System.out.println(min);

		sc.close();
	} 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 nowX = 0;
		int nowY = 0;
		int min = Integer.MAX_VALUE;
		for (int i = 0; i <= Math.max(2 * x, 2 * y); i += 2) {
			int sum = 0;
			nowX = Math.max(0, x - i / 2);
			nowY = Math.max(0, y - i / 2);
			sum = nowX * a + nowY * b + i * c;
			min = Math.min(min, sum);
		}

		System.out.println(min);

		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 nowX = 0; nowX 0 int nowY = 0; nowY 0 int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0; i <= Math.max(2 * x, 2 * y); i += 2) {
			int sum = 0;
			nowX = Math.max(0, x - i / 2);
			nowY = Math.max(0, y - i / 2);
			sum = nowX * a + nowY * b + i * c;
			min = Math.min(min, sum);
		} int i = 0; int i = 0; i 0 i <= Math.max(2 * x, 2 * y) i Math.max(2 * x, 2 * y) Math.max Math 2 * x 2 x 2 * y 2 y i += 2 i += 2 i 2 {
			int sum = 0;
			nowX = Math.max(0, x - i / 2);
			nowY = Math.max(0, y - i / 2);
			sum = nowX * a + nowY * b + i * c;
			min = Math.min(min, sum);
		} {
			int sum = 0;
			nowX = Math.max(0, x - i / 2);
			nowY = Math.max(0, y - i / 2);
			sum = nowX * a + nowY * b + i * c;
			min = Math.min(min, sum);
		} int sum = 0; sum 0 nowX = Math.max(0, x - i / 2) nowX Math.max(0, x - i / 2) Math.max Math 0 x - i / 2 x i / 2 i 2 nowY = Math.max(0, y - i / 2) nowY Math.max(0, y - i / 2) Math.max Math 0 y - i / 2 y i / 2 i 2 sum = nowX * a + nowY * b + i * c sum nowX * a + nowY * b + i * c nowX * a + nowY * b + i * c nowX * a nowX a nowY * b nowY b i * c i c min = Math.min(min, sum) min Math.min(min, sum) Math.min Math min sum System.out.println(min) System.out.println System.out System System.out min sc.close() sc.close sc 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 nowX = 0;
		int nowY = 0;
		int min = Integer.MAX_VALUE;
		for (int i = 0; i <= Math.max(2 * x, 2 * y); i += 2) {
			int sum = 0;
			nowX = Math.max(0, x - i / 2);
			nowY = Math.max(0, y - i / 2);
			sum = nowX * a + nowY * b + i * c;
			min = Math.min(min, sum);
		}

		System.out.println(min);

		sc.close();
	}
} 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 nowX = 0;
		int nowY = 0;
		int min = Integer.MAX_VALUE;
		for (int i = 0; i <= Math.max(2 * x, 2 * y); i += 2) {
			int sum = 0;
			nowX = Math.max(0, x - i / 2);
			nowY = Math.max(0, y - i / 2);
			sum = nowX * a + nowY * b + i * c;
			min = Math.min(min, sum);
		}

		System.out.println(min);

		sc.close();
	}
} 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 nowX = 0;
		int nowY = 0;
		int min = Integer.MAX_VALUE;
		for (int i = 0; i <= Math.max(2 * x, 2 * y); i += 2) {
			int sum = 0;
			nowX = Math.max(0, x - i / 2);
			nowY = Math.max(0, y - i / 2);
			sum = nowX * a + nowY * b + i * c;
			min = Math.min(min, sum);
		}

		System.out.println(min);

		sc.close();
	}
}