import java.io.IOException;
import java.util.Scanner;

public class Main {
    public static void main(String[] Arguments) throws IOException 
    {
        Scanner sc = new Scanner(System.in);
        long A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
        
        // Cost of Buying A and B Pizzas separately:
        long costAB = A * X + B * Y;
        
        // Common Number of A and B Pizzas
        long Same = Math.min(X, Y);
        X = X - Same; 
        Y = Y - Same;
        long costCombine = Same * 2 * C + A * X + B * Y;
        long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
        
        // Is it better to buy A and B Pizzas Seperately, or should he use AB Pizzas?
        long Best = Math.min(costAB, costCombine);
        Best = Math.min(Best, totalCost);
        System.out.println(Best);
    }
} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] Arguments) throws IOException 
    {
        Scanner sc = new Scanner(System.in);
        long A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
        
        // Cost of Buying A and B Pizzas separately:
        long costAB = A * X + B * Y;
        
        // Common Number of A and B Pizzas
        long Same = Math.min(X, Y);
        X = X - Same; 
        Y = Y - Same;
        long costCombine = Same * 2 * C + A * X + B * Y;
        long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
        
        // Is it better to buy A and B Pizzas Seperately, or should he use AB Pizzas?
        long Best = Math.min(costAB, costCombine);
        Best = Math.min(Best, totalCost);
        System.out.println(Best);
    }
} Main public static void main(String[] Arguments) throws IOException 
    {
        Scanner sc = new Scanner(System.in);
        long A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
        
        // Cost of Buying A and B Pizzas separately:
        long costAB = A * X + B * Y;
        
        // Common Number of A and B Pizzas
        long Same = Math.min(X, Y);
        X = X - Same; 
        Y = Y - Same;
        long costCombine = Same * 2 * C + A * X + B * Y;
        long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
        
        // Is it better to buy A and B Pizzas Seperately, or should he use AB Pizzas?
        long Best = Math.min(costAB, costCombine);
        Best = Math.min(Best, totalCost);
        System.out.println(Best);
    } main {
        Scanner sc = new Scanner(System.in);
        long A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
        
        // Cost of Buying A and B Pizzas separately:
        long costAB = A * X + B * Y;
        
        // Common Number of A and B Pizzas
        long Same = Math.min(X, Y);
        X = X - Same; 
        Y = Y - Same;
        long costCombine = Same * 2 * C + A * X + B * Y;
        long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
        
        // Is it better to buy A and B Pizzas Seperately, or should he use AB Pizzas?
        long Best = Math.min(costAB, costCombine);
        Best = Math.min(Best, totalCost);
        System.out.println(Best);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long 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 long costAB = A * X + B * Y; costAB A * X + B * Y A * X A X B * Y B Y long Same = Math.min(X, Y); Same Math.min(X, Y) Math.min Math X Y X = X - Same X X - Same X Same Y = Y - Same Y Y - Same Y Same long costCombine = Same * 2 * C + A * X + B * Y; costCombine Same * 2 * C + A * X + B * Y Same * 2 * C + A * X + B * Y Same * 2 * C Same * 2 * C Same 2 C A * X A X B * Y B Y long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C; totalCost Same * 2 * C + Math.max(X, Y) * 2 * C Same * 2 * C Same * 2 * C Same 2 C Math.max(X, Y) * 2 * C Math.max(X, Y) * 2 * C Math.max(X, Y) Math.max Math X Y 2 C long Best = Math.min(costAB, costCombine); Best Math.min(costAB, costCombine) Math.min Math costAB costCombine Best = Math.min(Best, totalCost) Best Math.min(Best, totalCost) Math.min Math Best totalCost System.out.println(Best) System.out.println System.out System System.out Best String[] Arguments Arguments public class Main {
    public static void main(String[] Arguments) throws IOException 
    {
        Scanner sc = new Scanner(System.in);
        long A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
        
        // Cost of Buying A and B Pizzas separately:
        long costAB = A * X + B * Y;
        
        // Common Number of A and B Pizzas
        long Same = Math.min(X, Y);
        X = X - Same; 
        Y = Y - Same;
        long costCombine = Same * 2 * C + A * X + B * Y;
        long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
        
        // Is it better to buy A and B Pizzas Seperately, or should he use AB Pizzas?
        long Best = Math.min(costAB, costCombine);
        Best = Math.min(Best, totalCost);
        System.out.println(Best);
    }
} public class Main {
    public static void main(String[] Arguments) throws IOException 
    {
        Scanner sc = new Scanner(System.in);
        long A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
        
        // Cost of Buying A and B Pizzas separately:
        long costAB = A * X + B * Y;
        
        // Common Number of A and B Pizzas
        long Same = Math.min(X, Y);
        X = X - Same; 
        Y = Y - Same;
        long costCombine = Same * 2 * C + A * X + B * Y;
        long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
        
        // Is it better to buy A and B Pizzas Seperately, or should he use AB Pizzas?
        long Best = Math.min(costAB, costCombine);
        Best = Math.min(Best, totalCost);
        System.out.println(Best);
    }
} Main
import java.io.IOException;
import java.util.Scanner;

public class Main {
    public static void main(String[] Arguments) throws IOException 
    {
        Scanner sc = new Scanner(System.in);
        long A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
        
        // Cost of Buying A and B Pizzas separately:
        long costAB = A * X + B * Y;
        
        // Common Number of A and B Pizzas
        long Same = Math.min(X, Y);
        X = X - Same; 
        Y = Y - Same;
        long costCombine = Same * 2 * C + A * X + B * Y;
        long totalCost = Same * 2 * C + Math.max(X, Y) * 2 * C;
        
        // Is it better to buy A and B Pizzas Seperately, or should he use AB Pizzas?
        long Best = Math.min(costAB, costCombine);
        Best = Math.min(Best, totalCost);
        System.out.println(Best);
    }
}