import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int normal = a * x + b * y;
        int half = c * Math.max(x, y) * 2;

        int comb = x > y ? a * (x - y) + c * Math.min(x, y) * 2 : b * (y - x) + c * Math.min(x, y) * 2;
        int price = Math.min(Math.min(normal, half), comb);

        int result = price;

        // 出力
        System.out.println(result);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int normal = a * x + b * y;
        int half = c * Math.max(x, y) * 2;

        int comb = x > y ? a * (x - y) + c * Math.min(x, y) * 2 : b * (y - x) + c * Math.min(x, y) * 2;
        int price = Math.min(Math.min(normal, half), comb);

        int result = price;

        // 出力
        System.out.println(result);
    }
} Main public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int normal = a * x + b * y;
        int half = c * Math.max(x, y) * 2;

        int comb = x > y ? a * (x - y) + c * Math.min(x, y) * 2 : b * (y - x) + c * Math.min(x, y) * 2;
        int price = Math.min(Math.min(normal, half), comb);

        int result = price;

        // 出力
        System.out.println(result);
    } main {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int normal = a * x + b * y;
        int half = c * Math.max(x, y) * 2;

        int comb = x > y ? a * (x - y) + c * Math.min(x, y) * 2 : b * (y - x) + c * Math.min(x, y) * 2;
        int price = Math.min(Math.min(normal, half), comb);

        int result = price;

        // 出力
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c = Integer.parseInt(sc.next()); c Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int x = Integer.parseInt(sc.next()); x Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int y = Integer.parseInt(sc.next()); y Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc int normal = a * x + b * y; normal a * x + b * y a * x a x b * y b y int half = c * Math.max(x, y) * 2; half c * Math.max(x, y) * 2 c * Math.max(x, y) * 2 c Math.max(x, y) Math.max Math x y 2 int comb = x > y ? a * (x - y) + c * Math.min(x, y) * 2 : b * (y - x) + c * Math.min(x, y) * 2; comb x > y ? a * (x - y) + c * Math.min(x, y) * 2 : b * (y - x) + c * Math.min(x, y) * 2 x > y x y a * (x - y) + c * Math.min(x, y) * 2 a * (x - y) a (x - y) x y c * Math.min(x, y) * 2 c * Math.min(x, y) * 2 c Math.min(x, y) Math.min Math x y 2 b * (y - x) + c * Math.min(x, y) * 2 b * (y - x) b (y - x) y x c * Math.min(x, y) * 2 c * Math.min(x, y) * 2 c Math.min(x, y) Math.min Math x y 2 int price = Math.min(Math.min(normal, half), comb); price Math.min(Math.min(normal, half), comb) Math.min Math Math.min(normal, half) Math.min Math normal half comb int result = price; result price System.out.println(result) System.out.println System.out System System.out result String args[] args public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int normal = a * x + b * y;
        int half = c * Math.max(x, y) * 2;

        int comb = x > y ? a * (x - y) + c * Math.min(x, y) * 2 : b * (y - x) + c * Math.min(x, y) * 2;
        int price = Math.min(Math.min(normal, half), comb);

        int result = price;

        // 出力
        System.out.println(result);
    }
} public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int normal = a * x + b * y;
        int half = c * Math.max(x, y) * 2;

        int comb = x > y ? a * (x - y) + c * Math.min(x, y) * 2 : b * (y - x) + c * Math.min(x, y) * 2;
        int price = Math.min(Math.min(normal, half), comb);

        int result = price;

        // 出力
        System.out.println(result);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int normal = a * x + b * y;
        int half = c * Math.max(x, y) * 2;

        int comb = x > y ? a * (x - y) + c * Math.min(x, y) * 2 : b * (y - x) + c * Math.min(x, y) * 2;
        int price = Math.min(Math.min(normal, half), comb);

        int result = price;

        // 出力
        System.out.println(result);
    }
}
