import java.util.Scanner;

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 ans =0;

		int aa = 0;
		int bb = 0;
		boolean a = false;
		boolean b = false;



		if(2*C <= A+B){

			while(aa < X && bb < Y){
				ans += 2*C;
				aa++;
				bb++;
				if(aa == X){
					a = true;

				}
				if(bb == Y){
					b = true;
				}

			}

			if(a){
				if(2*C > B){
					while(bb < Y){
						ans += B;
						bb++;
					}
				}else{
					while(bb < Y){
						ans += 2*C;
						bb++;
					}
				}
			}else{
				if(2*C > A){
					while(aa < X){
						ans += A;
						aa++;
					}
				}else{
					while(aa < X){
						ans += 2*C;
						aa++;
					}
				}
			}


		}else{

			while(aa != X){
				ans += A;
				aa++;
			}
			while(bb != Y){
				ans += B;
				bb++;
			}

		}

		System.out.println(ans);


	}

	static long comb(int n,int r){
		long ue = 1;
		for(int i = 0;i < r;i++){
			ue *= n-i;
		}
		long sita = 1;
		for(int i = 1;i <= r;i++){
			sita *= i;
		}
		return ue/sita;


	}





}




class Pair implements Comparable{
	String from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
}


 import java.util.Scanner; Scanner java.util 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 ans =0;

		int aa = 0;
		int bb = 0;
		boolean a = false;
		boolean b = false;



		if(2*C <= A+B){

			while(aa < X && bb < Y){
				ans += 2*C;
				aa++;
				bb++;
				if(aa == X){
					a = true;

				}
				if(bb == Y){
					b = true;
				}

			}

			if(a){
				if(2*C > B){
					while(bb < Y){
						ans += B;
						bb++;
					}
				}else{
					while(bb < Y){
						ans += 2*C;
						bb++;
					}
				}
			}else{
				if(2*C > A){
					while(aa < X){
						ans += A;
						aa++;
					}
				}else{
					while(aa < X){
						ans += 2*C;
						aa++;
					}
				}
			}


		}else{

			while(aa != X){
				ans += A;
				aa++;
			}
			while(bb != Y){
				ans += B;
				bb++;
			}

		}

		System.out.println(ans);


	}

	static long comb(int n,int r){
		long ue = 1;
		for(int i = 0;i < r;i++){
			ue *= n-i;
		}
		long sita = 1;
		for(int i = 1;i <= r;i++){
			sita *= i;
		}
		return ue/sita;


	}





} 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 ans =0;

		int aa = 0;
		int bb = 0;
		boolean a = false;
		boolean b = false;



		if(2*C <= A+B){

			while(aa < X && bb < Y){
				ans += 2*C;
				aa++;
				bb++;
				if(aa == X){
					a = true;

				}
				if(bb == Y){
					b = true;
				}

			}

			if(a){
				if(2*C > B){
					while(bb < Y){
						ans += B;
						bb++;
					}
				}else{
					while(bb < Y){
						ans += 2*C;
						bb++;
					}
				}
			}else{
				if(2*C > A){
					while(aa < X){
						ans += A;
						aa++;
					}
				}else{
					while(aa < X){
						ans += 2*C;
						aa++;
					}
				}
			}


		}else{

			while(aa != X){
				ans += A;
				aa++;
			}
			while(bb != Y){
				ans += B;
				bb++;
			}

		}

		System.out.println(ans);


	} 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 ans =0;

		int aa = 0;
		int bb = 0;
		boolean a = false;
		boolean b = false;



		if(2*C <= A+B){

			while(aa < X && bb < Y){
				ans += 2*C;
				aa++;
				bb++;
				if(aa == X){
					a = true;

				}
				if(bb == Y){
					b = true;
				}

			}

			if(a){
				if(2*C > B){
					while(bb < Y){
						ans += B;
						bb++;
					}
				}else{
					while(bb < Y){
						ans += 2*C;
						bb++;
					}
				}
			}else{
				if(2*C > A){
					while(aa < X){
						ans += A;
						aa++;
					}
				}else{
					while(aa < X){
						ans += 2*C;
						aa++;
					}
				}
			}


		}else{

			while(aa != X){
				ans += A;
				aa++;
			}
			while(bb != Y){
				ans += B;
				bb++;
			}

		}

		System.out.println(ans);


	} 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 ans =0; ans 0 int aa = 0; aa 0 int bb = 0; bb 0 boolean a = false; a false boolean b = false; b false if(2*C <= A+B){

			while(aa < X && bb < Y){
				ans += 2*C;
				aa++;
				bb++;
				if(aa == X){
					a = true;

				}
				if(bb == Y){
					b = true;
				}

			}

			if(a){
				if(2*C > B){
					while(bb < Y){
						ans += B;
						bb++;
					}
				}else{
					while(bb < Y){
						ans += 2*C;
						bb++;
					}
				}
			}else{
				if(2*C > A){
					while(aa < X){
						ans += A;
						aa++;
					}
				}else{
					while(aa < X){
						ans += 2*C;
						aa++;
					}
				}
			}


		}else{

			while(aa != X){
				ans += A;
				aa++;
			}
			while(bb != Y){
				ans += B;
				bb++;
			}

		} 2*C <= A+B 2*C 2 C A+B A B {

			while(aa < X && bb < Y){
				ans += 2*C;
				aa++;
				bb++;
				if(aa == X){
					a = true;

				}
				if(bb == Y){
					b = true;
				}

			}

			if(a){
				if(2*C > B){
					while(bb < Y){
						ans += B;
						bb++;
					}
				}else{
					while(bb < Y){
						ans += 2*C;
						bb++;
					}
				}
			}else{
				if(2*C > A){
					while(aa < X){
						ans += A;
						aa++;
					}
				}else{
					while(aa < X){
						ans += 2*C;
						aa++;
					}
				}
			}


		} while(aa < X && bb < Y){
				ans += 2*C;
				aa++;
				bb++;
				if(aa == X){
					a = true;

				}
				if(bb == Y){
					b = true;
				}

			} aa < X && bb < Y aa < X aa X bb < Y bb Y {
				ans += 2*C;
				aa++;
				bb++;
				if(aa == X){
					a = true;

				}
				if(bb == Y){
					b = true;
				}

			} ans += 2*C ans 2*C 2 C aa++ aa bb++ bb if(aa == X){
					a = true;

				} aa == X aa X {
					a = true;

				} a = true a true if(bb == Y){
					b = true;
				} bb == Y bb Y {
					b = true;
				} b = true b true if(a){
				if(2*C > B){
					while(bb < Y){
						ans += B;
						bb++;
					}
				}else{
					while(bb < Y){
						ans += 2*C;
						bb++;
					}
				}
			}else{
				if(2*C > A){
					while(aa < X){
						ans += A;
						aa++;
					}
				}else{
					while(aa < X){
						ans += 2*C;
						aa++;
					}
				}
			} a {
				if(2*C > B){
					while(bb < Y){
						ans += B;
						bb++;
					}
				}else{
					while(bb < Y){
						ans += 2*C;
						bb++;
					}
				}
			} if(2*C > B){
					while(bb < Y){
						ans += B;
						bb++;
					}
				}else{
					while(bb < Y){
						ans += 2*C;
						bb++;
					}
				} 2*C > B 2*C 2 C B {
					while(bb < Y){
						ans += B;
						bb++;
					}
				} while(bb < Y){
						ans += B;
						bb++;
					} bb < Y bb Y {
						ans += B;
						bb++;
					} ans += B ans B bb++ bb {
					while(bb < Y){
						ans += 2*C;
						bb++;
					}
				} while(bb < Y){
						ans += 2*C;
						bb++;
					} bb < Y bb Y {
						ans += 2*C;
						bb++;
					} ans += 2*C ans 2*C 2 C bb++ bb {
				if(2*C > A){
					while(aa < X){
						ans += A;
						aa++;
					}
				}else{
					while(aa < X){
						ans += 2*C;
						aa++;
					}
				}
			} if(2*C > A){
					while(aa < X){
						ans += A;
						aa++;
					}
				}else{
					while(aa < X){
						ans += 2*C;
						aa++;
					}
				} 2*C > A 2*C 2 C A {
					while(aa < X){
						ans += A;
						aa++;
					}
				} while(aa < X){
						ans += A;
						aa++;
					} aa < X aa X {
						ans += A;
						aa++;
					} ans += A ans A aa++ aa {
					while(aa < X){
						ans += 2*C;
						aa++;
					}
				} while(aa < X){
						ans += 2*C;
						aa++;
					} aa < X aa X {
						ans += 2*C;
						aa++;
					} ans += 2*C ans 2*C 2 C aa++ aa {

			while(aa != X){
				ans += A;
				aa++;
			}
			while(bb != Y){
				ans += B;
				bb++;
			}

		} while(aa != X){
				ans += A;
				aa++;
			} aa != X aa X {
				ans += A;
				aa++;
			} ans += A ans A aa++ aa while(bb != Y){
				ans += B;
				bb++;
			} bb != Y bb Y {
				ans += B;
				bb++;
			} ans += B ans B bb++ bb System.out.println(ans) System.out.println System.out System System.out ans String[] args args static long comb(int n,int r){
		long ue = 1;
		for(int i = 0;i < r;i++){
			ue *= n-i;
		}
		long sita = 1;
		for(int i = 1;i <= r;i++){
			sita *= i;
		}
		return ue/sita;


	} comb {
		long ue = 1;
		for(int i = 0;i < r;i++){
			ue *= n-i;
		}
		long sita = 1;
		for(int i = 1;i <= r;i++){
			sita *= i;
		}
		return ue/sita;


	} long ue = 1; ue 1 for(int i = 0;i < r;i++){
			ue *= n-i;
		} int i = 0; int i = 0; i 0 i < r i r i++ i++ i {
			ue *= n-i;
		} {
			ue *= n-i;
		} ue *= n-i ue n-i n i long sita = 1; sita 1 for(int i = 1;i <= r;i++){
			sita *= i;
		} int i = 1; int i = 1; i 1 i <= r i r i++ i++ i {
			sita *= i;
		} {
			sita *= i;
		} sita *= i sita i return ue/sita; ue/sita ue sita int n n int r r class Pair implements Comparable{
	String from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
} Pair String from; from int end; end @Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	} compareTo {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	} Pair otherpair = (Pair)other; otherpair (Pair)other return end - otherpair.end; end - otherpair.end end otherpair.end otherpair otherpair.end Object other other Comparable
import java.util.Scanner;

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 ans =0;

		int aa = 0;
		int bb = 0;
		boolean a = false;
		boolean b = false;



		if(2*C <= A+B){

			while(aa < X && bb < Y){
				ans += 2*C;
				aa++;
				bb++;
				if(aa == X){
					a = true;

				}
				if(bb == Y){
					b = true;
				}

			}

			if(a){
				if(2*C > B){
					while(bb < Y){
						ans += B;
						bb++;
					}
				}else{
					while(bb < Y){
						ans += 2*C;
						bb++;
					}
				}
			}else{
				if(2*C > A){
					while(aa < X){
						ans += A;
						aa++;
					}
				}else{
					while(aa < X){
						ans += 2*C;
						aa++;
					}
				}
			}


		}else{

			while(aa != X){
				ans += A;
				aa++;
			}
			while(bb != Y){
				ans += B;
				bb++;
			}

		}

		System.out.println(ans);


	}

	static long comb(int n,int r){
		long ue = 1;
		for(int i = 0;i < r;i++){
			ue *= n-i;
		}
		long sita = 1;
		for(int i = 1;i <= r;i++){
			sita *= i;
		}
		return ue/sita;


	}





}




class Pair implements Comparable{
	String from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
}



