import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    private static final BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    public static void main(String[] args) {
        String[] mem = readLineStandardInput().split(" ");
        int A = Integer.parseInt(mem[0]);
        int B = Integer.parseInt(mem[1]);
        int C = Integer.parseInt(mem[2]);
        int X = Integer.parseInt(mem[3]);
        int Y = Integer.parseInt(mem[4]);
        int remainX = X;
        int remainY = Y;
        int totalCost = 0;
        int sumAB = A + B;
        int minXY = X < Y ? X : Y;
        if(sumAB > 2 * C){
            totalCost += C * 2 * minXY;
            remainX -= minXY;
            remainY -= minXY;
        }
        if(remainX != 0){
            if(A > 2 * C){
                totalCost += 2 * C * remainX;
            }
            else{
                totalCost += A * remainX;
            }
        }
        if(remainY != 0) {
            if(B > 2 * C) {
                totalCost += 2 * C * remainY;
            }
            else {
                totalCost += B * remainY;
            }
        }
        System.out.println(totalCost);
    }

    private static String readLineStandardInput() {
        String str;
        try {
            str = input.readLine();
        } catch(IOException e){
            str = null;
            System.out.println(e);
        }
        return str;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    private static final BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    public static void main(String[] args) {
        String[] mem = readLineStandardInput().split(" ");
        int A = Integer.parseInt(mem[0]);
        int B = Integer.parseInt(mem[1]);
        int C = Integer.parseInt(mem[2]);
        int X = Integer.parseInt(mem[3]);
        int Y = Integer.parseInt(mem[4]);
        int remainX = X;
        int remainY = Y;
        int totalCost = 0;
        int sumAB = A + B;
        int minXY = X < Y ? X : Y;
        if(sumAB > 2 * C){
            totalCost += C * 2 * minXY;
            remainX -= minXY;
            remainY -= minXY;
        }
        if(remainX != 0){
            if(A > 2 * C){
                totalCost += 2 * C * remainX;
            }
            else{
                totalCost += A * remainX;
            }
        }
        if(remainY != 0) {
            if(B > 2 * C) {
                totalCost += 2 * C * remainY;
            }
            else {
                totalCost += B * remainY;
            }
        }
        System.out.println(totalCost);
    }

    private static String readLineStandardInput() {
        String str;
        try {
            str = input.readLine();
        } catch(IOException e){
            str = null;
            System.out.println(e);
        }
        return str;
    }
} Main private static final BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) public static void main(String[] args) {
        String[] mem = readLineStandardInput().split(" ");
        int A = Integer.parseInt(mem[0]);
        int B = Integer.parseInt(mem[1]);
        int C = Integer.parseInt(mem[2]);
        int X = Integer.parseInt(mem[3]);
        int Y = Integer.parseInt(mem[4]);
        int remainX = X;
        int remainY = Y;
        int totalCost = 0;
        int sumAB = A + B;
        int minXY = X < Y ? X : Y;
        if(sumAB > 2 * C){
            totalCost += C * 2 * minXY;
            remainX -= minXY;
            remainY -= minXY;
        }
        if(remainX != 0){
            if(A > 2 * C){
                totalCost += 2 * C * remainX;
            }
            else{
                totalCost += A * remainX;
            }
        }
        if(remainY != 0) {
            if(B > 2 * C) {
                totalCost += 2 * C * remainY;
            }
            else {
                totalCost += B * remainY;
            }
        }
        System.out.println(totalCost);
    } main {
        String[] mem = readLineStandardInput().split(" ");
        int A = Integer.parseInt(mem[0]);
        int B = Integer.parseInt(mem[1]);
        int C = Integer.parseInt(mem[2]);
        int X = Integer.parseInt(mem[3]);
        int Y = Integer.parseInt(mem[4]);
        int remainX = X;
        int remainY = Y;
        int totalCost = 0;
        int sumAB = A + B;
        int minXY = X < Y ? X : Y;
        if(sumAB > 2 * C){
            totalCost += C * 2 * minXY;
            remainX -= minXY;
            remainY -= minXY;
        }
        if(remainX != 0){
            if(A > 2 * C){
                totalCost += 2 * C * remainX;
            }
            else{
                totalCost += A * remainX;
            }
        }
        if(remainY != 0) {
            if(B > 2 * C) {
                totalCost += 2 * C * remainY;
            }
            else {
                totalCost += B * remainY;
            }
        }
        System.out.println(totalCost);
    } String[] mem = readLineStandardInput().split(" "); mem readLineStandardInput().split(" ") readLineStandardInput().split readLineStandardInput() readLineStandardInput " " int A = Integer.parseInt(mem[0]); A Integer.parseInt(mem[0]) Integer.parseInt Integer mem[0] mem 0 int B = Integer.parseInt(mem[1]); B Integer.parseInt(mem[1]) Integer.parseInt Integer mem[1] mem 1 int C = Integer.parseInt(mem[2]); C Integer.parseInt(mem[2]) Integer.parseInt Integer mem[2] mem 2 int X = Integer.parseInt(mem[3]); X Integer.parseInt(mem[3]) Integer.parseInt Integer mem[3] mem 3 int Y = Integer.parseInt(mem[4]); Y Integer.parseInt(mem[4]) Integer.parseInt Integer mem[4] mem 4 int remainX = X; remainX X int remainY = Y; remainY Y int totalCost = 0; totalCost 0 int sumAB = A + B; sumAB A + B A B int minXY = X < Y ? X : Y; minXY X < Y ? X : Y X < Y X Y X Y if(sumAB > 2 * C){
            totalCost += C * 2 * minXY;
            remainX -= minXY;
            remainY -= minXY;
        } sumAB > 2 * C sumAB 2 * C 2 C {
            totalCost += C * 2 * minXY;
            remainX -= minXY;
            remainY -= minXY;
        } totalCost += C * 2 * minXY totalCost C * 2 * minXY C * 2 * minXY C 2 minXY remainX -= minXY remainX minXY remainY -= minXY remainY minXY if(remainX != 0){
            if(A > 2 * C){
                totalCost += 2 * C * remainX;
            }
            else{
                totalCost += A * remainX;
            }
        } remainX != 0 remainX 0 {
            if(A > 2 * C){
                totalCost += 2 * C * remainX;
            }
            else{
                totalCost += A * remainX;
            }
        } if(A > 2 * C){
                totalCost += 2 * C * remainX;
            }
            else{
                totalCost += A * remainX;
            } A > 2 * C A 2 * C 2 C {
                totalCost += 2 * C * remainX;
            } totalCost += 2 * C * remainX totalCost 2 * C * remainX 2 * C * remainX 2 C remainX {
                totalCost += A * remainX;
            } totalCost += A * remainX totalCost A * remainX A remainX if(remainY != 0) {
            if(B > 2 * C) {
                totalCost += 2 * C * remainY;
            }
            else {
                totalCost += B * remainY;
            }
        } remainY != 0 remainY 0 {
            if(B > 2 * C) {
                totalCost += 2 * C * remainY;
            }
            else {
                totalCost += B * remainY;
            }
        } if(B > 2 * C) {
                totalCost += 2 * C * remainY;
            }
            else {
                totalCost += B * remainY;
            } B > 2 * C B 2 * C 2 C {
                totalCost += 2 * C * remainY;
            } totalCost += 2 * C * remainY totalCost 2 * C * remainY 2 * C * remainY 2 C remainY {
                totalCost += B * remainY;
            } totalCost += B * remainY totalCost B * remainY B remainY System.out.println(totalCost) System.out.println System.out System System.out totalCost String[] args args private static String readLineStandardInput() {
        String str;
        try {
            str = input.readLine();
        } catch(IOException e){
            str = null;
            System.out.println(e);
        }
        return str;
    } readLineStandardInput {
        String str;
        try {
            str = input.readLine();
        } catch(IOException e){
            str = null;
            System.out.println(e);
        }
        return str;
    } String str; str try {
            str = input.readLine();
        } catch(IOException e){
            str = null;
            System.out.println(e);
        } catch(IOException e){
            str = null;
            System.out.println(e);
        } IOException e {
            str = null;
            System.out.println(e);
        } str = null str null System.out.println(e) System.out.println System.out System System.out e {
            str = input.readLine();
        } str = input.readLine() str input.readLine() input.readLine input return str; str public class Main {
    private static final BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    public static void main(String[] args) {
        String[] mem = readLineStandardInput().split(" ");
        int A = Integer.parseInt(mem[0]);
        int B = Integer.parseInt(mem[1]);
        int C = Integer.parseInt(mem[2]);
        int X = Integer.parseInt(mem[3]);
        int Y = Integer.parseInt(mem[4]);
        int remainX = X;
        int remainY = Y;
        int totalCost = 0;
        int sumAB = A + B;
        int minXY = X < Y ? X : Y;
        if(sumAB > 2 * C){
            totalCost += C * 2 * minXY;
            remainX -= minXY;
            remainY -= minXY;
        }
        if(remainX != 0){
            if(A > 2 * C){
                totalCost += 2 * C * remainX;
            }
            else{
                totalCost += A * remainX;
            }
        }
        if(remainY != 0) {
            if(B > 2 * C) {
                totalCost += 2 * C * remainY;
            }
            else {
                totalCost += B * remainY;
            }
        }
        System.out.println(totalCost);
    }

    private static String readLineStandardInput() {
        String str;
        try {
            str = input.readLine();
        } catch(IOException e){
            str = null;
            System.out.println(e);
        }
        return str;
    }
} public class Main {
    private static final BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    public static void main(String[] args) {
        String[] mem = readLineStandardInput().split(" ");
        int A = Integer.parseInt(mem[0]);
        int B = Integer.parseInt(mem[1]);
        int C = Integer.parseInt(mem[2]);
        int X = Integer.parseInt(mem[3]);
        int Y = Integer.parseInt(mem[4]);
        int remainX = X;
        int remainY = Y;
        int totalCost = 0;
        int sumAB = A + B;
        int minXY = X < Y ? X : Y;
        if(sumAB > 2 * C){
            totalCost += C * 2 * minXY;
            remainX -= minXY;
            remainY -= minXY;
        }
        if(remainX != 0){
            if(A > 2 * C){
                totalCost += 2 * C * remainX;
            }
            else{
                totalCost += A * remainX;
            }
        }
        if(remainY != 0) {
            if(B > 2 * C) {
                totalCost += 2 * C * remainY;
            }
            else {
                totalCost += B * remainY;
            }
        }
        System.out.println(totalCost);
    }

    private static String readLineStandardInput() {
        String str;
        try {
            str = input.readLine();
        } catch(IOException e){
            str = null;
            System.out.println(e);
        }
        return str;
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    private static final BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    public static void main(String[] args) {
        String[] mem = readLineStandardInput().split(" ");
        int A = Integer.parseInt(mem[0]);
        int B = Integer.parseInt(mem[1]);
        int C = Integer.parseInt(mem[2]);
        int X = Integer.parseInt(mem[3]);
        int Y = Integer.parseInt(mem[4]);
        int remainX = X;
        int remainY = Y;
        int totalCost = 0;
        int sumAB = A + B;
        int minXY = X < Y ? X : Y;
        if(sumAB > 2 * C){
            totalCost += C * 2 * minXY;
            remainX -= minXY;
            remainY -= minXY;
        }
        if(remainX != 0){
            if(A > 2 * C){
                totalCost += 2 * C * remainX;
            }
            else{
                totalCost += A * remainX;
            }
        }
        if(remainY != 0) {
            if(B > 2 * C) {
                totalCost += 2 * C * remainY;
            }
            else {
                totalCost += B * remainY;
            }
        }
        System.out.println(totalCost);
    }

    private static String readLineStandardInput() {
        String str;
        try {
            str = input.readLine();
        } catch(IOException e){
            str = null;
            System.out.println(e);
        }
        return str;
    }
}
