import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int A,B,C,X,Y,sum_price=0;
        ArrayList<Integer> price = new ArrayList<>();
        A=sc.nextInt();
        B=sc.nextInt();
        C=sc.nextInt();
        X=sc.nextInt();
        Y=sc.nextInt();
        int L;
        if(X>Y)L=X;
        else L=Y;
        for(int a=0;a<=L;a++){
            sum_price =0;
            sum_price += C*2*a;
            for(int b=0;b<X-a;b++){
                sum_price += A;
            }
            for(int c=0;c<Y-a;c++){
                sum_price +=B;
            }
            price.add(sum_price);
        }
        System.out.println(Collections.min(price));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int A,B,C,X,Y,sum_price=0;
        ArrayList<Integer> price = new ArrayList<>();
        A=sc.nextInt();
        B=sc.nextInt();
        C=sc.nextInt();
        X=sc.nextInt();
        Y=sc.nextInt();
        int L;
        if(X>Y)L=X;
        else L=Y;
        for(int a=0;a<=L;a++){
            sum_price =0;
            sum_price += C*2*a;
            for(int b=0;b<X-a;b++){
                sum_price += A;
            }
            for(int c=0;c<Y-a;c++){
                sum_price +=B;
            }
            price.add(sum_price);
        }
        System.out.println(Collections.min(price));
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int A,B,C,X,Y,sum_price=0;
        ArrayList<Integer> price = new ArrayList<>();
        A=sc.nextInt();
        B=sc.nextInt();
        C=sc.nextInt();
        X=sc.nextInt();
        Y=sc.nextInt();
        int L;
        if(X>Y)L=X;
        else L=Y;
        for(int a=0;a<=L;a++){
            sum_price =0;
            sum_price += C*2*a;
            for(int b=0;b<X-a;b++){
                sum_price += A;
            }
            for(int c=0;c<Y-a;c++){
                sum_price +=B;
            }
            price.add(sum_price);
        }
        System.out.println(Collections.min(price));
    } main {
        Scanner sc = new Scanner(System.in);
        int A,B,C,X,Y,sum_price=0;
        ArrayList<Integer> price = new ArrayList<>();
        A=sc.nextInt();
        B=sc.nextInt();
        C=sc.nextInt();
        X=sc.nextInt();
        Y=sc.nextInt();
        int L;
        if(X>Y)L=X;
        else L=Y;
        for(int a=0;a<=L;a++){
            sum_price =0;
            sum_price += C*2*a;
            for(int b=0;b<X-a;b++){
                sum_price += A;
            }
            for(int c=0;c<Y-a;c++){
                sum_price +=B;
            }
            price.add(sum_price);
        }
        System.out.println(Collections.min(price));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A A B B C C X X Y Y sum_price=0; sum_price 0 ArrayList<Integer> price = new ArrayList<>(); price new ArrayList<>() A=sc.nextInt() A sc.nextInt() sc.nextInt sc B=sc.nextInt() B sc.nextInt() sc.nextInt sc C=sc.nextInt() C sc.nextInt() sc.nextInt sc X=sc.nextInt() X sc.nextInt() sc.nextInt sc Y=sc.nextInt() Y sc.nextInt() sc.nextInt sc int L; L if(X>Y)L=X;
        else L=Y; X>Y X Y L=X L X L=Y L Y for(int a=0;a<=L;a++){
            sum_price =0;
            sum_price += C*2*a;
            for(int b=0;b<X-a;b++){
                sum_price += A;
            }
            for(int c=0;c<Y-a;c++){
                sum_price +=B;
            }
            price.add(sum_price);
        } int a=0; int a=0; a 0 a<=L a L a++ a++ a {
            sum_price =0;
            sum_price += C*2*a;
            for(int b=0;b<X-a;b++){
                sum_price += A;
            }
            for(int c=0;c<Y-a;c++){
                sum_price +=B;
            }
            price.add(sum_price);
        } {
            sum_price =0;
            sum_price += C*2*a;
            for(int b=0;b<X-a;b++){
                sum_price += A;
            }
            for(int c=0;c<Y-a;c++){
                sum_price +=B;
            }
            price.add(sum_price);
        } sum_price =0 sum_price 0 sum_price += C*2*a sum_price C*2*a C*2*a C 2 a for(int b=0;b<X-a;b++){
                sum_price += A;
            } int b=0; int b=0; b 0 b<X-a b X-a X a b++ b++ b {
                sum_price += A;
            } {
                sum_price += A;
            } sum_price += A sum_price A for(int c=0;c<Y-a;c++){
                sum_price +=B;
            } int c=0; int c=0; c 0 c<Y-a c Y-a Y a c++ c++ c {
                sum_price +=B;
            } {
                sum_price +=B;
            } sum_price +=B sum_price B price.add(sum_price) price.add price sum_price System.out.println(Collections.min(price)) System.out.println System.out System System.out Collections.min(price) Collections.min Collections price String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int A,B,C,X,Y,sum_price=0;
        ArrayList<Integer> price = new ArrayList<>();
        A=sc.nextInt();
        B=sc.nextInt();
        C=sc.nextInt();
        X=sc.nextInt();
        Y=sc.nextInt();
        int L;
        if(X>Y)L=X;
        else L=Y;
        for(int a=0;a<=L;a++){
            sum_price =0;
            sum_price += C*2*a;
            for(int b=0;b<X-a;b++){
                sum_price += A;
            }
            for(int c=0;c<Y-a;c++){
                sum_price +=B;
            }
            price.add(sum_price);
        }
        System.out.println(Collections.min(price));
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int A,B,C,X,Y,sum_price=0;
        ArrayList<Integer> price = new ArrayList<>();
        A=sc.nextInt();
        B=sc.nextInt();
        C=sc.nextInt();
        X=sc.nextInt();
        Y=sc.nextInt();
        int L;
        if(X>Y)L=X;
        else L=Y;
        for(int a=0;a<=L;a++){
            sum_price =0;
            sum_price += C*2*a;
            for(int b=0;b<X-a;b++){
                sum_price += A;
            }
            for(int c=0;c<Y-a;c++){
                sum_price +=B;
            }
            price.add(sum_price);
        }
        System.out.println(Collections.min(price));
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int A,B,C,X,Y,sum_price=0;
        ArrayList<Integer> price = new ArrayList<>();
        A=sc.nextInt();
        B=sc.nextInt();
        C=sc.nextInt();
        X=sc.nextInt();
        Y=sc.nextInt();
        int L;
        if(X>Y)L=X;
        else L=Y;
        for(int a=0;a<=L;a++){
            sum_price =0;
            sum_price += C*2*a;
            for(int b=0;b<X-a;b++){
                sum_price += A;
            }
            for(int c=0;c<Y-a;c++){
                sum_price +=B;
            }
            price.add(sum_price);
        }
        System.out.println(Collections.min(price));
    }
}