import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A, B, C, X, Y;
		A = sc.nextInt();
		B = sc.nextInt();
		C = sc.nextInt();
		X = sc.nextInt();
		Y = sc.nextInt();
		long ans = Long.MAX_VALUE;
		for (int k = 0; k <= 100000; k++) {
			int res = 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B;
			ans = Math.min(ans, res);
		}

		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A, B, C, X, Y;
		A = sc.nextInt();
		B = sc.nextInt();
		C = sc.nextInt();
		X = sc.nextInt();
		Y = sc.nextInt();
		long ans = Long.MAX_VALUE;
		for (int k = 0; k <= 100000; k++) {
			int res = 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B;
			ans = Math.min(ans, res);
		}

		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A, B, C, X, Y;
		A = sc.nextInt();
		B = sc.nextInt();
		C = sc.nextInt();
		X = sc.nextInt();
		Y = sc.nextInt();
		long ans = Long.MAX_VALUE;
		for (int k = 0; k <= 100000; k++) {
			int res = 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B;
			ans = Math.min(ans, res);
		}

		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int A, B, C, X, Y;
		A = sc.nextInt();
		B = sc.nextInt();
		C = sc.nextInt();
		X = sc.nextInt();
		Y = sc.nextInt();
		long ans = Long.MAX_VALUE;
		for (int k = 0; k <= 100000; k++) {
			int res = 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B;
			ans = Math.min(ans, res);
		}

		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A A B B C C X X Y; Y A = sc.nextInt() A sc.nextInt() sc.nextInt sc B = sc.nextInt() B sc.nextInt() sc.nextInt sc C = sc.nextInt() C sc.nextInt() sc.nextInt sc X = sc.nextInt() X sc.nextInt() sc.nextInt sc Y = sc.nextInt() Y sc.nextInt() sc.nextInt sc long ans = Long.MAX_VALUE; ans Long.MAX_VALUE Long Long.MAX_VALUE for (int k = 0; k <= 100000; k++) {
			int res = 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B;
			ans = Math.min(ans, res);
		} int k = 0; int k = 0; k 0 k <= 100000 k 100000 k++ k++ k {
			int res = 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B;
			ans = Math.min(ans, res);
		} {
			int res = 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B;
			ans = Math.min(ans, res);
		} int res = 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B; res 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B 2 * C * k 2 * C * k 2 C k Math.max(X - k, 0) * A Math.max(X - k, 0) Math.max Math X - k X k 0 A Math.max(Y - k, 0) * B Math.max(Y - k, 0) Math.max Math Y - k Y k 0 B ans = Math.min(ans, res) ans Math.min(ans, res) Math.min Math ans res System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A, B, C, X, Y;
		A = sc.nextInt();
		B = sc.nextInt();
		C = sc.nextInt();
		X = sc.nextInt();
		Y = sc.nextInt();
		long ans = Long.MAX_VALUE;
		for (int k = 0; k <= 100000; k++) {
			int res = 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B;
			ans = Math.min(ans, res);
		}

		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A, B, C, X, Y;
		A = sc.nextInt();
		B = sc.nextInt();
		C = sc.nextInt();
		X = sc.nextInt();
		Y = sc.nextInt();
		long ans = Long.MAX_VALUE;
		for (int k = 0; k <= 100000; k++) {
			int res = 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B;
			ans = Math.min(ans, res);
		}

		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A, B, C, X, Y;
		A = sc.nextInt();
		B = sc.nextInt();
		C = sc.nextInt();
		X = sc.nextInt();
		Y = sc.nextInt();
		long ans = Long.MAX_VALUE;
		for (int k = 0; k <= 100000; k++) {
			int res = 2 * C * k + Math.max(X - k, 0) * A + Math.max(Y - k, 0) * B;
			ans = Math.min(ans, res);
		}

		System.out.println(ans);
	}
}