import java.util.*;


public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int priceA = sc.nextInt();
        int priceB = sc.nextInt();
        int priceAB = sc.nextInt();
        int needACount = sc.nextInt();
        int needBCount = sc.nextInt();
        
        int countOfTheMore = Math.max(needACount, needBCount);
        int countOfTheLess = Math.min(needACount, needBCount);
        int priceOfCountOfTheMore = 0;
        if (countOfTheLess == needACount) {
            priceOfCountOfTheMore = priceB;
        } else {
            priceOfCountOfTheMore = priceA;
        }
        
        int pricePlanA = priceA * needACount + priceB * needBCount;
        int pricePlanB = priceAB * 2 * countOfTheMore;
        int pricePlanC = priceAB * 2 * countOfTheLess + priceOfCountOfTheMore * (countOfTheMore - countOfTheLess);
        int answer = 0;
        if (pricePlanA < pricePlanB) {
            answer = pricePlanA;
        } else {
            answer = pricePlanB;
        }
        
        if (pricePlanC < answer) {
            answer = pricePlanC;
        }
        
        System.out.println(answer);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int priceA = sc.nextInt();
        int priceB = sc.nextInt();
        int priceAB = sc.nextInt();
        int needACount = sc.nextInt();
        int needBCount = sc.nextInt();
        
        int countOfTheMore = Math.max(needACount, needBCount);
        int countOfTheLess = Math.min(needACount, needBCount);
        int priceOfCountOfTheMore = 0;
        if (countOfTheLess == needACount) {
            priceOfCountOfTheMore = priceB;
        } else {
            priceOfCountOfTheMore = priceA;
        }
        
        int pricePlanA = priceA * needACount + priceB * needBCount;
        int pricePlanB = priceAB * 2 * countOfTheMore;
        int pricePlanC = priceAB * 2 * countOfTheLess + priceOfCountOfTheMore * (countOfTheMore - countOfTheLess);
        int answer = 0;
        if (pricePlanA < pricePlanB) {
            answer = pricePlanA;
        } else {
            answer = pricePlanB;
        }
        
        if (pricePlanC < answer) {
            answer = pricePlanC;
        }
        
        System.out.println(answer);
    }
} Main public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int priceA = sc.nextInt();
        int priceB = sc.nextInt();
        int priceAB = sc.nextInt();
        int needACount = sc.nextInt();
        int needBCount = sc.nextInt();
        
        int countOfTheMore = Math.max(needACount, needBCount);
        int countOfTheLess = Math.min(needACount, needBCount);
        int priceOfCountOfTheMore = 0;
        if (countOfTheLess == needACount) {
            priceOfCountOfTheMore = priceB;
        } else {
            priceOfCountOfTheMore = priceA;
        }
        
        int pricePlanA = priceA * needACount + priceB * needBCount;
        int pricePlanB = priceAB * 2 * countOfTheMore;
        int pricePlanC = priceAB * 2 * countOfTheLess + priceOfCountOfTheMore * (countOfTheMore - countOfTheLess);
        int answer = 0;
        if (pricePlanA < pricePlanB) {
            answer = pricePlanA;
        } else {
            answer = pricePlanB;
        }
        
        if (pricePlanC < answer) {
            answer = pricePlanC;
        }
        
        System.out.println(answer);
    } main {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int priceA = sc.nextInt();
        int priceB = sc.nextInt();
        int priceAB = sc.nextInt();
        int needACount = sc.nextInt();
        int needBCount = sc.nextInt();
        
        int countOfTheMore = Math.max(needACount, needBCount);
        int countOfTheLess = Math.min(needACount, needBCount);
        int priceOfCountOfTheMore = 0;
        if (countOfTheLess == needACount) {
            priceOfCountOfTheMore = priceB;
        } else {
            priceOfCountOfTheMore = priceA;
        }
        
        int pricePlanA = priceA * needACount + priceB * needBCount;
        int pricePlanB = priceAB * 2 * countOfTheMore;
        int pricePlanC = priceAB * 2 * countOfTheLess + priceOfCountOfTheMore * (countOfTheMore - countOfTheLess);
        int answer = 0;
        if (pricePlanA < pricePlanB) {
            answer = pricePlanA;
        } else {
            answer = pricePlanB;
        }
        
        if (pricePlanC < answer) {
            answer = pricePlanC;
        }
        
        System.out.println(answer);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int priceA = sc.nextInt(); priceA sc.nextInt() sc.nextInt sc int priceB = sc.nextInt(); priceB sc.nextInt() sc.nextInt sc int priceAB = sc.nextInt(); priceAB sc.nextInt() sc.nextInt sc int needACount = sc.nextInt(); needACount sc.nextInt() sc.nextInt sc int needBCount = sc.nextInt(); needBCount sc.nextInt() sc.nextInt sc int countOfTheMore = Math.max(needACount, needBCount); countOfTheMore Math.max(needACount, needBCount) Math.max Math needACount needBCount int countOfTheLess = Math.min(needACount, needBCount); countOfTheLess Math.min(needACount, needBCount) Math.min Math needACount needBCount int priceOfCountOfTheMore = 0; priceOfCountOfTheMore 0 if (countOfTheLess == needACount) {
            priceOfCountOfTheMore = priceB;
        } else {
            priceOfCountOfTheMore = priceA;
        } countOfTheLess == needACount countOfTheLess needACount {
            priceOfCountOfTheMore = priceB;
        } priceOfCountOfTheMore = priceB priceOfCountOfTheMore priceB {
            priceOfCountOfTheMore = priceA;
        } priceOfCountOfTheMore = priceA priceOfCountOfTheMore priceA int pricePlanA = priceA * needACount + priceB * needBCount; pricePlanA priceA * needACount + priceB * needBCount priceA * needACount priceA needACount priceB * needBCount priceB needBCount int pricePlanB = priceAB * 2 * countOfTheMore; pricePlanB priceAB * 2 * countOfTheMore priceAB * 2 * countOfTheMore priceAB 2 countOfTheMore int pricePlanC = priceAB * 2 * countOfTheLess + priceOfCountOfTheMore * (countOfTheMore - countOfTheLess); pricePlanC priceAB * 2 * countOfTheLess + priceOfCountOfTheMore * (countOfTheMore - countOfTheLess) priceAB * 2 * countOfTheLess priceAB * 2 * countOfTheLess priceAB 2 countOfTheLess priceOfCountOfTheMore * (countOfTheMore - countOfTheLess) priceOfCountOfTheMore (countOfTheMore - countOfTheLess) countOfTheMore countOfTheLess int answer = 0; answer 0 if (pricePlanA < pricePlanB) {
            answer = pricePlanA;
        } else {
            answer = pricePlanB;
        } pricePlanA < pricePlanB pricePlanA pricePlanB {
            answer = pricePlanA;
        } answer = pricePlanA answer pricePlanA {
            answer = pricePlanB;
        } answer = pricePlanB answer pricePlanB if (pricePlanC < answer) {
            answer = pricePlanC;
        } pricePlanC < answer pricePlanC answer {
            answer = pricePlanC;
        } answer = pricePlanC answer pricePlanC System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int priceA = sc.nextInt();
        int priceB = sc.nextInt();
        int priceAB = sc.nextInt();
        int needACount = sc.nextInt();
        int needBCount = sc.nextInt();
        
        int countOfTheMore = Math.max(needACount, needBCount);
        int countOfTheLess = Math.min(needACount, needBCount);
        int priceOfCountOfTheMore = 0;
        if (countOfTheLess == needACount) {
            priceOfCountOfTheMore = priceB;
        } else {
            priceOfCountOfTheMore = priceA;
        }
        
        int pricePlanA = priceA * needACount + priceB * needBCount;
        int pricePlanB = priceAB * 2 * countOfTheMore;
        int pricePlanC = priceAB * 2 * countOfTheLess + priceOfCountOfTheMore * (countOfTheMore - countOfTheLess);
        int answer = 0;
        if (pricePlanA < pricePlanB) {
            answer = pricePlanA;
        } else {
            answer = pricePlanB;
        }
        
        if (pricePlanC < answer) {
            answer = pricePlanC;
        }
        
        System.out.println(answer);
    }
} public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int priceA = sc.nextInt();
        int priceB = sc.nextInt();
        int priceAB = sc.nextInt();
        int needACount = sc.nextInt();
        int needBCount = sc.nextInt();
        
        int countOfTheMore = Math.max(needACount, needBCount);
        int countOfTheLess = Math.min(needACount, needBCount);
        int priceOfCountOfTheMore = 0;
        if (countOfTheLess == needACount) {
            priceOfCountOfTheMore = priceB;
        } else {
            priceOfCountOfTheMore = priceA;
        }
        
        int pricePlanA = priceA * needACount + priceB * needBCount;
        int pricePlanB = priceAB * 2 * countOfTheMore;
        int pricePlanC = priceAB * 2 * countOfTheLess + priceOfCountOfTheMore * (countOfTheMore - countOfTheLess);
        int answer = 0;
        if (pricePlanA < pricePlanB) {
            answer = pricePlanA;
        } else {
            answer = pricePlanB;
        }
        
        if (pricePlanC < answer) {
            answer = pricePlanC;
        }
        
        System.out.println(answer);
    }
} Main
import java.util.*;


public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        int priceA = sc.nextInt();
        int priceB = sc.nextInt();
        int priceAB = sc.nextInt();
        int needACount = sc.nextInt();
        int needBCount = sc.nextInt();
        
        int countOfTheMore = Math.max(needACount, needBCount);
        int countOfTheLess = Math.min(needACount, needBCount);
        int priceOfCountOfTheMore = 0;
        if (countOfTheLess == needACount) {
            priceOfCountOfTheMore = priceB;
        } else {
            priceOfCountOfTheMore = priceA;
        }
        
        int pricePlanA = priceA * needACount + priceB * needBCount;
        int pricePlanB = priceAB * 2 * countOfTheMore;
        int pricePlanC = priceAB * 2 * countOfTheLess + priceOfCountOfTheMore * (countOfTheMore - countOfTheLess);
        int answer = 0;
        if (pricePlanA < pricePlanB) {
            answer = pricePlanA;
        } else {
            answer = pricePlanB;
        }
        
        if (pricePlanC < answer) {
            answer = pricePlanC;
        }
        
        System.out.println(answer);
    }
}