import 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 AB = sc.nextInt();
		int X = sc.nextInt();
      	int Y = sc.nextInt();
      	
        Long sum = (long) 0;
      	if(2*AB>=(A+B)){
          	sum = (long) (A*X+B*Y);
      		System.out.println(sum);
          	return;
        }
      
      	int min = X;
      	int max = Y;
      	int addpizza = B; 
      	
      	if(Y<X){
        	min = Y;
          	max = X;
          	addpizza = A; 
        }
      
        Long sum2 = (long) (2*AB*max);
      	sum = (long) (addpizza*(max-min)+2*(AB*min));
      	if(sum<sum2){
      		System.out.println(sum);
        }else{
          System.out.println(sum2);
        }
        return;
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int A = sc.nextInt();
      	int B = sc.nextInt();
     	int AB = sc.nextInt();
		int X = sc.nextInt();
      	int Y = sc.nextInt();
      	
        Long sum = (long) 0;
      	if(2*AB>=(A+B)){
          	sum = (long) (A*X+B*Y);
      		System.out.println(sum);
          	return;
        }
      
      	int min = X;
      	int max = Y;
      	int addpizza = B; 
      	
      	if(Y<X){
        	min = Y;
          	max = X;
          	addpizza = A; 
        }
      
        Long sum2 = (long) (2*AB*max);
      	sum = (long) (addpizza*(max-min)+2*(AB*min));
      	if(sum<sum2){
      		System.out.println(sum);
        }else{
          System.out.println(sum2);
        }
        return;
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int A = sc.nextInt();
      	int B = sc.nextInt();
     	int AB = sc.nextInt();
		int X = sc.nextInt();
      	int Y = sc.nextInt();
      	
        Long sum = (long) 0;
      	if(2*AB>=(A+B)){
          	sum = (long) (A*X+B*Y);
      		System.out.println(sum);
          	return;
        }
      
      	int min = X;
      	int max = Y;
      	int addpizza = B; 
      	
      	if(Y<X){
        	min = Y;
          	max = X;
          	addpizza = A; 
        }
      
        Long sum2 = (long) (2*AB*max);
      	sum = (long) (addpizza*(max-min)+2*(AB*min));
      	if(sum<sum2){
      		System.out.println(sum);
        }else{
          System.out.println(sum2);
        }
        return;
	} main {
		Scanner sc = new Scanner(System.in);
      	int A = sc.nextInt();
      	int B = sc.nextInt();
     	int AB = sc.nextInt();
		int X = sc.nextInt();
      	int Y = sc.nextInt();
      	
        Long sum = (long) 0;
      	if(2*AB>=(A+B)){
          	sum = (long) (A*X+B*Y);
      		System.out.println(sum);
          	return;
        }
      
      	int min = X;
      	int max = Y;
      	int addpizza = B; 
      	
      	if(Y<X){
        	min = Y;
          	max = X;
          	addpizza = A; 
        }
      
        Long sum2 = (long) (2*AB*max);
      	sum = (long) (addpizza*(max-min)+2*(AB*min));
      	if(sum<sum2){
      		System.out.println(sum);
        }else{
          System.out.println(sum2);
        }
        return;
	} 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 AB = sc.nextInt(); AB 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 Long sum = (long) 0; sum (long) 0 if(2*AB>=(A+B)){
          	sum = (long) (A*X+B*Y);
      		System.out.println(sum);
          	return;
        } 2*AB>=(A+B) 2*AB 2 AB (A+B) A B {
          	sum = (long) (A*X+B*Y);
      		System.out.println(sum);
          	return;
        } sum = (long) (A*X+B*Y) sum (long) (A*X+B*Y) A*X A X B*Y B Y System.out.println(sum) System.out.println System.out System System.out sum return; int min = X; min X int max = Y; max Y int addpizza = B; addpizza B if(Y<X){
        	min = Y;
          	max = X;
          	addpizza = A; 
        } Y<X Y X {
        	min = Y;
          	max = X;
          	addpizza = A; 
        } min = Y min Y max = X max X addpizza = A addpizza A Long sum2 = (long) (2*AB*max); sum2 (long) (2*AB*max) 2*AB*max 2 AB max sum = (long) (addpizza*(max-min)+2*(AB*min)) sum (long) (addpizza*(max-min)+2*(AB*min)) addpizza*(max-min) addpizza (max-min) max min 2*(AB*min) 2 (AB*min) AB min if(sum<sum2){
      		System.out.println(sum);
        }else{
          System.out.println(sum2);
        } sum<sum2 sum sum2 {
      		System.out.println(sum);
        } System.out.println(sum) System.out.println System.out System System.out sum {
          System.out.println(sum2);
        } System.out.println(sum2) System.out.println System.out System System.out sum2 return; 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 AB = sc.nextInt();
		int X = sc.nextInt();
      	int Y = sc.nextInt();
      	
        Long sum = (long) 0;
      	if(2*AB>=(A+B)){
          	sum = (long) (A*X+B*Y);
      		System.out.println(sum);
          	return;
        }
      
      	int min = X;
      	int max = Y;
      	int addpizza = B; 
      	
      	if(Y<X){
        	min = Y;
          	max = X;
          	addpizza = A; 
        }
      
        Long sum2 = (long) (2*AB*max);
      	sum = (long) (addpizza*(max-min)+2*(AB*min));
      	if(sum<sum2){
      		System.out.println(sum);
        }else{
          System.out.println(sum2);
        }
        return;
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int A = sc.nextInt();
      	int B = sc.nextInt();
     	int AB = sc.nextInt();
		int X = sc.nextInt();
      	int Y = sc.nextInt();
      	
        Long sum = (long) 0;
      	if(2*AB>=(A+B)){
          	sum = (long) (A*X+B*Y);
      		System.out.println(sum);
          	return;
        }
      
      	int min = X;
      	int max = Y;
      	int addpizza = B; 
      	
      	if(Y<X){
        	min = Y;
          	max = X;
          	addpizza = A; 
        }
      
        Long sum2 = (long) (2*AB*max);
      	sum = (long) (addpizza*(max-min)+2*(AB*min));
      	if(sum<sum2){
      		System.out.println(sum);
        }else{
          System.out.println(sum2);
        }
        return;
	}
} Main
import 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 AB = sc.nextInt();
		int X = sc.nextInt();
      	int Y = sc.nextInt();
      	
        Long sum = (long) 0;
      	if(2*AB>=(A+B)){
          	sum = (long) (A*X+B*Y);
      		System.out.println(sum);
          	return;
        }
      
      	int min = X;
      	int max = Y;
      	int addpizza = B; 
      	
      	if(Y<X){
        	min = Y;
          	max = X;
          	addpizza = A; 
        }
      
        Long sum2 = (long) (2*AB*max);
      	sum = (long) (addpizza*(max-min)+2*(AB*min));
      	if(sum<sum2){
      		System.out.println(sum);
        }else{
          System.out.println(sum2);
        }
        return;
	}
}
