import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int X = reader.nextInt();
		int Y = reader.nextInt();
		int ans = 0;
		boolean isCheaperThanAB = A + B > C * 2;
		boolean isCheaperThanA = A > C * 2;
		boolean isCheaperThanB = B > C * 2;

		if (isCheaperThanAB) {
			int num = Math.min(X, Y);
			ans += num * 2 * C;
			X -= num;
			Y -= num;
		}
		if (isCheaperThanA) {
			ans += X * C * 2;
			X = 0;
		}
		if (isCheaperThanB) {
			ans += Y * C * 2;
			Y = 0;
		}
		ans += X * A;
		ans += Y * B;

		reader.close();
		System.out.print(ans);
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int X = reader.nextInt();
		int Y = reader.nextInt();
		int ans = 0;
		boolean isCheaperThanAB = A + B > C * 2;
		boolean isCheaperThanA = A > C * 2;
		boolean isCheaperThanB = B > C * 2;

		if (isCheaperThanAB) {
			int num = Math.min(X, Y);
			ans += num * 2 * C;
			X -= num;
			Y -= num;
		}
		if (isCheaperThanA) {
			ans += X * C * 2;
			X = 0;
		}
		if (isCheaperThanB) {
			ans += Y * C * 2;
			Y = 0;
		}
		ans += X * A;
		ans += Y * B;

		reader.close();
		System.out.print(ans);
	}
} Main public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int X = reader.nextInt();
		int Y = reader.nextInt();
		int ans = 0;
		boolean isCheaperThanAB = A + B > C * 2;
		boolean isCheaperThanA = A > C * 2;
		boolean isCheaperThanB = B > C * 2;

		if (isCheaperThanAB) {
			int num = Math.min(X, Y);
			ans += num * 2 * C;
			X -= num;
			Y -= num;
		}
		if (isCheaperThanA) {
			ans += X * C * 2;
			X = 0;
		}
		if (isCheaperThanB) {
			ans += Y * C * 2;
			Y = 0;
		}
		ans += X * A;
		ans += Y * B;

		reader.close();
		System.out.print(ans);
	} main {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int X = reader.nextInt();
		int Y = reader.nextInt();
		int ans = 0;
		boolean isCheaperThanAB = A + B > C * 2;
		boolean isCheaperThanA = A > C * 2;
		boolean isCheaperThanB = B > C * 2;

		if (isCheaperThanAB) {
			int num = Math.min(X, Y);
			ans += num * 2 * C;
			X -= num;
			Y -= num;
		}
		if (isCheaperThanA) {
			ans += X * C * 2;
			X = 0;
		}
		if (isCheaperThanB) {
			ans += Y * C * 2;
			Y = 0;
		}
		ans += X * A;
		ans += Y * B;

		reader.close();
		System.out.print(ans);
	} Scanner reader = new Scanner(System.in); reader new Scanner(System.in) int A = reader.nextInt(); A reader.nextInt() reader.nextInt reader int B = reader.nextInt(); B reader.nextInt() reader.nextInt reader int C = reader.nextInt(); C reader.nextInt() reader.nextInt reader int X = reader.nextInt(); X reader.nextInt() reader.nextInt reader int Y = reader.nextInt(); Y reader.nextInt() reader.nextInt reader int ans = 0; ans 0 boolean isCheaperThanAB = A + B > C * 2; isCheaperThanAB A + B > C * 2 A + B A B C * 2 C 2 boolean isCheaperThanA = A > C * 2; isCheaperThanA A > C * 2 A C * 2 C 2 boolean isCheaperThanB = B > C * 2; isCheaperThanB B > C * 2 B C * 2 C 2 if (isCheaperThanAB) {
			int num = Math.min(X, Y);
			ans += num * 2 * C;
			X -= num;
			Y -= num;
		} isCheaperThanAB {
			int num = Math.min(X, Y);
			ans += num * 2 * C;
			X -= num;
			Y -= num;
		} int num = Math.min(X, Y); num Math.min(X, Y) Math.min Math X Y ans += num * 2 * C ans num * 2 * C num * 2 * C num 2 C X -= num X num Y -= num Y num if (isCheaperThanA) {
			ans += X * C * 2;
			X = 0;
		} isCheaperThanA {
			ans += X * C * 2;
			X = 0;
		} ans += X * C * 2 ans X * C * 2 X * C * 2 X C 2 X = 0 X 0 if (isCheaperThanB) {
			ans += Y * C * 2;
			Y = 0;
		} isCheaperThanB {
			ans += Y * C * 2;
			Y = 0;
		} ans += Y * C * 2 ans Y * C * 2 Y * C * 2 Y C 2 Y = 0 Y 0 ans += X * A ans X * A X A ans += Y * B ans Y * B Y B reader.close() reader.close reader System.out.print(ans) System.out.print System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int X = reader.nextInt();
		int Y = reader.nextInt();
		int ans = 0;
		boolean isCheaperThanAB = A + B > C * 2;
		boolean isCheaperThanA = A > C * 2;
		boolean isCheaperThanB = B > C * 2;

		if (isCheaperThanAB) {
			int num = Math.min(X, Y);
			ans += num * 2 * C;
			X -= num;
			Y -= num;
		}
		if (isCheaperThanA) {
			ans += X * C * 2;
			X = 0;
		}
		if (isCheaperThanB) {
			ans += Y * C * 2;
			Y = 0;
		}
		ans += X * A;
		ans += Y * B;

		reader.close();
		System.out.print(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int X = reader.nextInt();
		int Y = reader.nextInt();
		int ans = 0;
		boolean isCheaperThanAB = A + B > C * 2;
		boolean isCheaperThanA = A > C * 2;
		boolean isCheaperThanB = B > C * 2;

		if (isCheaperThanAB) {
			int num = Math.min(X, Y);
			ans += num * 2 * C;
			X -= num;
			Y -= num;
		}
		if (isCheaperThanA) {
			ans += X * C * 2;
			X = 0;
		}
		if (isCheaperThanB) {
			ans += Y * C * 2;
			Y = 0;
		}
		ans += X * A;
		ans += Y * B;

		reader.close();
		System.out.print(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int C = reader.nextInt();
		int X = reader.nextInt();
		int Y = reader.nextInt();
		int ans = 0;
		boolean isCheaperThanAB = A + B > C * 2;
		boolean isCheaperThanA = A > C * 2;
		boolean isCheaperThanB = B > C * 2;

		if (isCheaperThanAB) {
			int num = Math.min(X, Y);
			ans += num * 2 * C;
			X -= num;
			Y -= num;
		}
		if (isCheaperThanA) {
			ans += X * C * 2;
			X = 0;
		}
		if (isCheaperThanB) {
			ans += Y * C * 2;
			Y = 0;
		}
		ans += X * A;
		ans += Y * B;

		reader.close();
		System.out.print(ans);
	}
}

