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