import java.util.Scanner;
import java.math.*;

class Main {
    public static void main(String[] args){
    	 Scanner sc = new Scanner(System.in);
         int aPrice = sc.nextInt();
         int bPrice = sc.nextInt();
         int abPrice = sc.nextInt();
         int aNeed = sc.nextInt();
         int bNeed = sc.nextInt();
         int most,res;
         if(aNeed>bNeed){
            most = aPrice;
         }else{
            most = bPrice;
         }
         if(aPrice+bPrice<=2*abPrice){
            res = (aPrice*aNeed)+(bPrice*bNeed);
         }else{
            res = (abPrice*Math.min(aNeed,bNeed)*2)+(Math.min(most,2*abPrice)*Math.abs(aNeed-bNeed));
         }
         System.out.println(res);
    }    
} import java.util.Scanner; Scanner java.util import java.math.*; math.* java class Main {
    public static void main(String[] args){
    	 Scanner sc = new Scanner(System.in);
         int aPrice = sc.nextInt();
         int bPrice = sc.nextInt();
         int abPrice = sc.nextInt();
         int aNeed = sc.nextInt();
         int bNeed = sc.nextInt();
         int most,res;
         if(aNeed>bNeed){
            most = aPrice;
         }else{
            most = bPrice;
         }
         if(aPrice+bPrice<=2*abPrice){
            res = (aPrice*aNeed)+(bPrice*bNeed);
         }else{
            res = (abPrice*Math.min(aNeed,bNeed)*2)+(Math.min(most,2*abPrice)*Math.abs(aNeed-bNeed));
         }
         System.out.println(res);
    }    
} Main public static void main(String[] args){
    	 Scanner sc = new Scanner(System.in);
         int aPrice = sc.nextInt();
         int bPrice = sc.nextInt();
         int abPrice = sc.nextInt();
         int aNeed = sc.nextInt();
         int bNeed = sc.nextInt();
         int most,res;
         if(aNeed>bNeed){
            most = aPrice;
         }else{
            most = bPrice;
         }
         if(aPrice+bPrice<=2*abPrice){
            res = (aPrice*aNeed)+(bPrice*bNeed);
         }else{
            res = (abPrice*Math.min(aNeed,bNeed)*2)+(Math.min(most,2*abPrice)*Math.abs(aNeed-bNeed));
         }
         System.out.println(res);
    } main {
    	 Scanner sc = new Scanner(System.in);
         int aPrice = sc.nextInt();
         int bPrice = sc.nextInt();
         int abPrice = sc.nextInt();
         int aNeed = sc.nextInt();
         int bNeed = sc.nextInt();
         int most,res;
         if(aNeed>bNeed){
            most = aPrice;
         }else{
            most = bPrice;
         }
         if(aPrice+bPrice<=2*abPrice){
            res = (aPrice*aNeed)+(bPrice*bNeed);
         }else{
            res = (abPrice*Math.min(aNeed,bNeed)*2)+(Math.min(most,2*abPrice)*Math.abs(aNeed-bNeed));
         }
         System.out.println(res);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int aPrice = sc.nextInt(); aPrice sc.nextInt() sc.nextInt sc int bPrice = sc.nextInt(); bPrice sc.nextInt() sc.nextInt sc int abPrice = sc.nextInt(); abPrice sc.nextInt() sc.nextInt sc int aNeed = sc.nextInt(); aNeed sc.nextInt() sc.nextInt sc int bNeed = sc.nextInt(); bNeed sc.nextInt() sc.nextInt sc int most most res; res if(aNeed>bNeed){
            most = aPrice;
         }else{
            most = bPrice;
         } aNeed>bNeed aNeed bNeed {
            most = aPrice;
         } most = aPrice most aPrice {
            most = bPrice;
         } most = bPrice most bPrice if(aPrice+bPrice<=2*abPrice){
            res = (aPrice*aNeed)+(bPrice*bNeed);
         }else{
            res = (abPrice*Math.min(aNeed,bNeed)*2)+(Math.min(most,2*abPrice)*Math.abs(aNeed-bNeed));
         } aPrice+bPrice<=2*abPrice aPrice+bPrice aPrice bPrice 2*abPrice 2 abPrice {
            res = (aPrice*aNeed)+(bPrice*bNeed);
         } res = (aPrice*aNeed)+(bPrice*bNeed) res (aPrice*aNeed)+(bPrice*bNeed) (aPrice*aNeed) aPrice aNeed (bPrice*bNeed) bPrice bNeed {
            res = (abPrice*Math.min(aNeed,bNeed)*2)+(Math.min(most,2*abPrice)*Math.abs(aNeed-bNeed));
         } res = (abPrice*Math.min(aNeed,bNeed)*2)+(Math.min(most,2*abPrice)*Math.abs(aNeed-bNeed)) res (abPrice*Math.min(aNeed,bNeed)*2)+(Math.min(most,2*abPrice)*Math.abs(aNeed-bNeed)) (abPrice*Math.min(aNeed,bNeed)*2) abPrice*Math.min(aNeed,bNeed)*2 abPrice Math.min(aNeed,bNeed) Math.min Math aNeed bNeed 2 (Math.min(most,2*abPrice)*Math.abs(aNeed-bNeed)) Math.min(most,2*abPrice) Math.min Math most 2*abPrice 2 abPrice Math.abs(aNeed-bNeed) Math.abs Math aNeed-bNeed aNeed bNeed System.out.println(res) System.out.println System.out System System.out res String[] args args
import java.util.Scanner;
import java.math.*;

class Main {
    public static void main(String[] args){
    	 Scanner sc = new Scanner(System.in);
         int aPrice = sc.nextInt();
         int bPrice = sc.nextInt();
         int abPrice = sc.nextInt();
         int aNeed = sc.nextInt();
         int bNeed = sc.nextInt();
         int most,res;
         if(aNeed>bNeed){
            most = aPrice;
         }else{
            most = bPrice;
         }
         if(aPrice+bPrice<=2*abPrice){
            res = (aPrice*aNeed)+(bPrice*bNeed);
         }else{
            res = (abPrice*Math.min(aNeed,bNeed)*2)+(Math.min(most,2*abPrice)*Math.abs(aNeed-bNeed));
         }
         System.out.println(res);
    }    
}