import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int a = Integer.parseInt(str[0]);
		int b = Integer.parseInt(str[1]);
		int c = Integer.parseInt(str[2]);
		int x = Integer.parseInt(str[3]);
		int y = Integer.parseInt(str[4]);

		int max = Math.max(x, y);

		long ans = Long.MAX_VALUE;
		for (int i = 0; i <= max * 2; i += 2) {
			int X = (x - i / 2) < 0 ? 0 : (x - i / 2);
			int Y = (y - i / 2) < 0 ? 0 : (y - i / 2);

			ans = Math.min(ans, i * c + X * a + Y * b);
		}

		System.out.println(ans);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int a = Integer.parseInt(str[0]);
		int b = Integer.parseInt(str[1]);
		int c = Integer.parseInt(str[2]);
		int x = Integer.parseInt(str[3]);
		int y = Integer.parseInt(str[4]);

		int max = Math.max(x, y);

		long ans = Long.MAX_VALUE;
		for (int i = 0; i <= max * 2; i += 2) {
			int X = (x - i / 2) < 0 ? 0 : (x - i / 2);
			int Y = (y - i / 2) < 0 ? 0 : (y - i / 2);

			ans = Math.min(ans, i * c + X * a + Y * b);
		}

		System.out.println(ans);
	}
} Main public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int a = Integer.parseInt(str[0]);
		int b = Integer.parseInt(str[1]);
		int c = Integer.parseInt(str[2]);
		int x = Integer.parseInt(str[3]);
		int y = Integer.parseInt(str[4]);

		int max = Math.max(x, y);

		long ans = Long.MAX_VALUE;
		for (int i = 0; i <= max * 2; i += 2) {
			int X = (x - i / 2) < 0 ? 0 : (x - i / 2);
			int Y = (y - i / 2) < 0 ? 0 : (y - i / 2);

			ans = Math.min(ans, i * c + X * a + Y * b);
		}

		System.out.println(ans);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int a = Integer.parseInt(str[0]);
		int b = Integer.parseInt(str[1]);
		int c = Integer.parseInt(str[2]);
		int x = Integer.parseInt(str[3]);
		int y = Integer.parseInt(str[4]);

		int max = Math.max(x, y);

		long ans = Long.MAX_VALUE;
		for (int i = 0; i <= max * 2; i += 2) {
			int X = (x - i / 2) < 0 ? 0 : (x - i / 2);
			int Y = (y - i / 2) < 0 ? 0 : (y - i / 2);

			ans = Math.min(ans, i * c + X * a + Y * b);
		}

		System.out.println(ans);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str[] = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int a = Integer.parseInt(str[0]); a Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int b = Integer.parseInt(str[1]); b Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int c = Integer.parseInt(str[2]); c Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 int x = Integer.parseInt(str[3]); x Integer.parseInt(str[3]) Integer.parseInt Integer str[3] str 3 int y = Integer.parseInt(str[4]); y Integer.parseInt(str[4]) Integer.parseInt Integer str[4] str 4 int max = Math.max(x, y); max Math.max(x, y) Math.max Math x y long ans = Long.MAX_VALUE; ans Long.MAX_VALUE Long Long.MAX_VALUE for (int i = 0; i <= max * 2; i += 2) {
			int X = (x - i / 2) < 0 ? 0 : (x - i / 2);
			int Y = (y - i / 2) < 0 ? 0 : (y - i / 2);

			ans = Math.min(ans, i * c + X * a + Y * b);
		} int i = 0; int i = 0; i 0 i <= max * 2 i max * 2 max 2 i += 2 i += 2 i 2 {
			int X = (x - i / 2) < 0 ? 0 : (x - i / 2);
			int Y = (y - i / 2) < 0 ? 0 : (y - i / 2);

			ans = Math.min(ans, i * c + X * a + Y * b);
		} {
			int X = (x - i / 2) < 0 ? 0 : (x - i / 2);
			int Y = (y - i / 2) < 0 ? 0 : (y - i / 2);

			ans = Math.min(ans, i * c + X * a + Y * b);
		} int X = (x - i / 2) < 0 ? 0 : (x - i / 2); X (x - i / 2) < 0 ? 0 : (x - i / 2) (x - i / 2) < 0 (x - i / 2) x i / 2 i 2 0 0 (x - i / 2) x i / 2 i 2 int Y = (y - i / 2) < 0 ? 0 : (y - i / 2); Y (y - i / 2) < 0 ? 0 : (y - i / 2) (y - i / 2) < 0 (y - i / 2) y i / 2 i 2 0 0 (y - i / 2) y i / 2 i 2 ans = Math.min(ans, i * c + X * a + Y * b) ans Math.min(ans, i * c + X * a + Y * b) Math.min Math ans i * c + X * a + Y * b i * c + X * a + Y * b i * c i c X * a X a Y * b Y b 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[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int a = Integer.parseInt(str[0]);
		int b = Integer.parseInt(str[1]);
		int c = Integer.parseInt(str[2]);
		int x = Integer.parseInt(str[3]);
		int y = Integer.parseInt(str[4]);

		int max = Math.max(x, y);

		long ans = Long.MAX_VALUE;
		for (int i = 0; i <= max * 2; i += 2) {
			int X = (x - i / 2) < 0 ? 0 : (x - i / 2);
			int Y = (y - i / 2) < 0 ? 0 : (y - i / 2);

			ans = Math.min(ans, i * c + X * a + Y * b);
		}

		System.out.println(ans);
	}
} public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int a = Integer.parseInt(str[0]);
		int b = Integer.parseInt(str[1]);
		int c = Integer.parseInt(str[2]);
		int x = Integer.parseInt(str[3]);
		int y = Integer.parseInt(str[4]);

		int max = Math.max(x, y);

		long ans = Long.MAX_VALUE;
		for (int i = 0; i <= max * 2; i += 2) {
			int X = (x - i / 2) < 0 ? 0 : (x - i / 2);
			int Y = (y - i / 2) < 0 ? 0 : (y - i / 2);

			ans = Math.min(ans, i * c + X * a + Y * b);
		}

		System.out.println(ans);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int a = Integer.parseInt(str[0]);
		int b = Integer.parseInt(str[1]);
		int c = Integer.parseInt(str[2]);
		int x = Integer.parseInt(str[3]);
		int y = Integer.parseInt(str[4]);

		int max = Math.max(x, y);

		long ans = Long.MAX_VALUE;
		for (int i = 0; i <= max * 2; i += 2) {
			int X = (x - i / 2) < 0 ? 0 : (x - i / 2);
			int Y = (y - i / 2) < 0 ? 0 : (y - i / 2);

			ans = Math.min(ans, i * c + X * a + Y * b);
		}

		System.out.println(ans);
	}
}