import java.util.Scanner;

class Solver {

    private final int A;
    private final int B;
    private final int AB;
    private final int X;
    private final int Y;

    Solver(Scanner in){
        A = in.nextInt();
        B = in.nextInt();
        AB = in.nextInt();
        X = in.nextInt();
        Y = in.nextInt();
    }

    void solve() {
        if (A + B <= AB * 2) {
            System.out.println(A * X + B * Y);
            return;
        }
        int max = Math.max(X, Y);
        int min = Math.min(X, Y);
        int temp = A * X + B * Y;
        for (int i = min; i <= max; i++) {
            temp = Math.min(i * 2 * AB + A * Math.max(X - i, 0) + B * Math.max(Y - i, 0), temp);
        }
        System.out.println(temp);
    }
}

class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);

        new Solver(in).solve();

        in.close();
    }
} import java.util.Scanner; Scanner java.util class Solver {

    private final int A;
    private final int B;
    private final int AB;
    private final int X;
    private final int Y;

    Solver(Scanner in){
        A = in.nextInt();
        B = in.nextInt();
        AB = in.nextInt();
        X = in.nextInt();
        Y = in.nextInt();
    }

    void solve() {
        if (A + B <= AB * 2) {
            System.out.println(A * X + B * Y);
            return;
        }
        int max = Math.max(X, Y);
        int min = Math.min(X, Y);
        int temp = A * X + B * Y;
        for (int i = min; i <= max; i++) {
            temp = Math.min(i * 2 * AB + A * Math.max(X - i, 0) + B * Math.max(Y - i, 0), temp);
        }
        System.out.println(temp);
    }
} Solver private final int A; A private final int B; B private final int AB; AB private final int X; X private final int Y; Y Solver(Scanner in){
        A = in.nextInt();
        B = in.nextInt();
        AB = in.nextInt();
        X = in.nextInt();
        Y = in.nextInt();
    } Solver {
        A = in.nextInt();
        B = in.nextInt();
        AB = in.nextInt();
        X = in.nextInt();
        Y = in.nextInt();
    } A = in.nextInt() A in.nextInt() in.nextInt in B = in.nextInt() B in.nextInt() in.nextInt in AB = in.nextInt() AB in.nextInt() in.nextInt in X = in.nextInt() X in.nextInt() in.nextInt in Y = in.nextInt() Y in.nextInt() in.nextInt in Scanner in in void solve() {
        if (A + B <= AB * 2) {
            System.out.println(A * X + B * Y);
            return;
        }
        int max = Math.max(X, Y);
        int min = Math.min(X, Y);
        int temp = A * X + B * Y;
        for (int i = min; i <= max; i++) {
            temp = Math.min(i * 2 * AB + A * Math.max(X - i, 0) + B * Math.max(Y - i, 0), temp);
        }
        System.out.println(temp);
    } solve {
        if (A + B <= AB * 2) {
            System.out.println(A * X + B * Y);
            return;
        }
        int max = Math.max(X, Y);
        int min = Math.min(X, Y);
        int temp = A * X + B * Y;
        for (int i = min; i <= max; i++) {
            temp = Math.min(i * 2 * AB + A * Math.max(X - i, 0) + B * Math.max(Y - i, 0), temp);
        }
        System.out.println(temp);
    } if (A + B <= AB * 2) {
            System.out.println(A * X + B * Y);
            return;
        } A + B <= AB * 2 A + B A B AB * 2 AB 2 {
            System.out.println(A * X + B * Y);
            return;
        } System.out.println(A * X + B * Y) System.out.println System.out System System.out A * X + B * Y A * X A X B * Y B Y return; int max = Math.max(X, Y); max Math.max(X, Y) Math.max Math X Y int min = Math.min(X, Y); min Math.min(X, Y) Math.min Math X Y int temp = A * X + B * Y; temp A * X + B * Y A * X A X B * Y B Y for (int i = min; i <= max; i++) {
            temp = Math.min(i * 2 * AB + A * Math.max(X - i, 0) + B * Math.max(Y - i, 0), temp);
        } int i = min; int i = min; i min i <= max i max i++ i++ i {
            temp = Math.min(i * 2 * AB + A * Math.max(X - i, 0) + B * Math.max(Y - i, 0), temp);
        } {
            temp = Math.min(i * 2 * AB + A * Math.max(X - i, 0) + B * Math.max(Y - i, 0), temp);
        } temp = Math.min(i * 2 * AB + A * Math.max(X - i, 0) + B * Math.max(Y - i, 0), temp) temp Math.min(i * 2 * AB + A * Math.max(X - i, 0) + B * Math.max(Y - i, 0), temp) Math.min Math i * 2 * AB + A * Math.max(X - i, 0) + B * Math.max(Y - i, 0) i * 2 * AB + A * Math.max(X - i, 0) + B * Math.max(Y - i, 0) i * 2 * AB i * 2 * AB i 2 AB A * Math.max(X - i, 0) A Math.max(X - i, 0) Math.max Math X - i X i 0 B * Math.max(Y - i, 0) B Math.max(Y - i, 0) Math.max Math Y - i Y i 0 temp System.out.println(temp) System.out.println System.out System System.out temp class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);

        new Solver(in).solve();

        in.close();
    }
} Main public static void main(String[] args){
        Scanner in = new Scanner(System.in);

        new Solver(in).solve();

        in.close();
    } main {
        Scanner in = new Scanner(System.in);

        new Solver(in).solve();

        in.close();
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) new Solver(in).solve() new Solver(in).solve new Solver(in) in.close() in.close in String[] args args
import java.util.Scanner;

class Solver {

    private final int A;
    private final int B;
    private final int AB;
    private final int X;
    private final int Y;

    Solver(Scanner in){
        A = in.nextInt();
        B = in.nextInt();
        AB = in.nextInt();
        X = in.nextInt();
        Y = in.nextInt();
    }

    void solve() {
        if (A + B <= AB * 2) {
            System.out.println(A * X + B * Y);
            return;
        }
        int max = Math.max(X, Y);
        int min = Math.min(X, Y);
        int temp = A * X + B * Y;
        for (int i = min; i <= max; i++) {
            temp = Math.min(i * 2 * AB + A * Math.max(X - i, 0) + B * Math.max(Y - i, 0), temp);
        }
        System.out.println(temp);
    }
}

class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);

        new Solver(in).solve();

        in.close();
    }
}