import java.util.Scanner;

class Main {
    static public void main(String args[]){

        Scanner scan = new Scanner(System.in);
        int Apizza = scan.nextInt();
        int Bpizza = scan.nextInt();
        int ABpizza = scan.nextInt();
        int X = scan.nextInt();
        int Y = scan.nextInt();

        int price=(int)1e9;

        price = Math.min(price, ABpizza * Math.max(X,Y)) * 2;
        price = Math.min(price, ABpizza * Math.min(X,Y) * 2 + (Math.max(X,Y)==X ? Apizza : Bpizza) * Math.abs(X-Y));
        price = Math.min(price, Apizza * X + Bpizza * Y);

        System.out.println(price);

    }
} import java.util.Scanner; Scanner java.util class Main {
    static public void main(String args[]){

        Scanner scan = new Scanner(System.in);
        int Apizza = scan.nextInt();
        int Bpizza = scan.nextInt();
        int ABpizza = scan.nextInt();
        int X = scan.nextInt();
        int Y = scan.nextInt();

        int price=(int)1e9;

        price = Math.min(price, ABpizza * Math.max(X,Y)) * 2;
        price = Math.min(price, ABpizza * Math.min(X,Y) * 2 + (Math.max(X,Y)==X ? Apizza : Bpizza) * Math.abs(X-Y));
        price = Math.min(price, Apizza * X + Bpizza * Y);

        System.out.println(price);

    }
} Main static public void main(String args[]){

        Scanner scan = new Scanner(System.in);
        int Apizza = scan.nextInt();
        int Bpizza = scan.nextInt();
        int ABpizza = scan.nextInt();
        int X = scan.nextInt();
        int Y = scan.nextInt();

        int price=(int)1e9;

        price = Math.min(price, ABpizza * Math.max(X,Y)) * 2;
        price = Math.min(price, ABpizza * Math.min(X,Y) * 2 + (Math.max(X,Y)==X ? Apizza : Bpizza) * Math.abs(X-Y));
        price = Math.min(price, Apizza * X + Bpizza * Y);

        System.out.println(price);

    } main {

        Scanner scan = new Scanner(System.in);
        int Apizza = scan.nextInt();
        int Bpizza = scan.nextInt();
        int ABpizza = scan.nextInt();
        int X = scan.nextInt();
        int Y = scan.nextInt();

        int price=(int)1e9;

        price = Math.min(price, ABpizza * Math.max(X,Y)) * 2;
        price = Math.min(price, ABpizza * Math.min(X,Y) * 2 + (Math.max(X,Y)==X ? Apizza : Bpizza) * Math.abs(X-Y));
        price = Math.min(price, Apizza * X + Bpizza * Y);

        System.out.println(price);

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int Apizza = scan.nextInt(); Apizza scan.nextInt() scan.nextInt scan int Bpizza = scan.nextInt(); Bpizza scan.nextInt() scan.nextInt scan int ABpizza = scan.nextInt(); ABpizza scan.nextInt() scan.nextInt scan int X = scan.nextInt(); X scan.nextInt() scan.nextInt scan int Y = scan.nextInt(); Y scan.nextInt() scan.nextInt scan int price=(int)1e9; price (int)1e9 price = Math.min(price, ABpizza * Math.max(X,Y)) * 2 price Math.min(price, ABpizza * Math.max(X,Y)) * 2 Math.min(price, ABpizza * Math.max(X,Y)) Math.min Math price ABpizza * Math.max(X,Y) ABpizza Math.max(X,Y) Math.max Math X Y 2 price = Math.min(price, ABpizza * Math.min(X,Y) * 2 + (Math.max(X,Y)==X ? Apizza : Bpizza) * Math.abs(X-Y)) price Math.min(price, ABpizza * Math.min(X,Y) * 2 + (Math.max(X,Y)==X ? Apizza : Bpizza) * Math.abs(X-Y)) Math.min Math price ABpizza * Math.min(X,Y) * 2 + (Math.max(X,Y)==X ? Apizza : Bpizza) * Math.abs(X-Y) ABpizza * Math.min(X,Y) * 2 ABpizza * Math.min(X,Y) * 2 ABpizza Math.min(X,Y) Math.min Math X Y 2 (Math.max(X,Y)==X ? Apizza : Bpizza) * Math.abs(X-Y) (Math.max(X,Y)==X ? Apizza : Bpizza) Math.max(X,Y)==X Math.max(X,Y) Math.max Math X Y X Apizza Bpizza Math.abs(X-Y) Math.abs Math X-Y X Y price = Math.min(price, Apizza * X + Bpizza * Y) price Math.min(price, Apizza * X + Bpizza * Y) Math.min Math price Apizza * X + Bpizza * Y Apizza * X Apizza X Bpizza * Y Bpizza Y System.out.println(price) System.out.println System.out System System.out price String args[] args
import java.util.Scanner;

class Main {
    static public void main(String args[]){

        Scanner scan = new Scanner(System.in);
        int Apizza = scan.nextInt();
        int Bpizza = scan.nextInt();
        int ABpizza = scan.nextInt();
        int X = scan.nextInt();
        int Y = scan.nextInt();

        int price=(int)1e9;

        price = Math.min(price, ABpizza * Math.max(X,Y)) * 2;
        price = Math.min(price, ABpizza * Math.min(X,Y) * 2 + (Math.max(X,Y)==X ? Apizza : Bpizza) * Math.abs(X-Y));
        price = Math.min(price, Apizza * X + Bpizza * Y);

        System.out.println(price);

    }
}