import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        int[] a = { 0, 0, 0, 0, 0 };
        Scanner scan = new Scanner(System.in);
        if (scan.hasNextInt()) {
            for (int i = 0; i < a.length; i++) {
                a[i] = scan.nextInt();
            }
        }
        int sum = 0;

        if (a[0] + a[1] <= a[2] * 2) {
            sum = a[0] * a[3] + a[1] * a[4];
        } else {
            if (a[3] >= a[4]) {
                sum = a[4] * 2 * a[2];
                sum = sum + (a[3] - a[4]) * a[0];
            } else {
                sum = a[3] * 2 * a[2];
                sum = sum + (a[4] - a[3]) * a[1];
            }

        }
        int sum1 = 0;
        if (a[3] >= a[4]) {
            sum1 = a[3] * a[2] * 2;
        }
        if (a[3] < a[4]) {
            sum1 = a[4] * a[2] * 2;
        }
        if (sum > sum1) {
            sum = sum1;
        }
        System.out.println(sum);
        scan.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        int[] a = { 0, 0, 0, 0, 0 };
        Scanner scan = new Scanner(System.in);
        if (scan.hasNextInt()) {
            for (int i = 0; i < a.length; i++) {
                a[i] = scan.nextInt();
            }
        }
        int sum = 0;

        if (a[0] + a[1] <= a[2] * 2) {
            sum = a[0] * a[3] + a[1] * a[4];
        } else {
            if (a[3] >= a[4]) {
                sum = a[4] * 2 * a[2];
                sum = sum + (a[3] - a[4]) * a[0];
            } else {
                sum = a[3] * 2 * a[2];
                sum = sum + (a[4] - a[3]) * a[1];
            }

        }
        int sum1 = 0;
        if (a[3] >= a[4]) {
            sum1 = a[3] * a[2] * 2;
        }
        if (a[3] < a[4]) {
            sum1 = a[4] * a[2] * 2;
        }
        if (sum > sum1) {
            sum = sum1;
        }
        System.out.println(sum);
        scan.close();
    }
} Main public static void main(String[] args) {
        int[] a = { 0, 0, 0, 0, 0 };
        Scanner scan = new Scanner(System.in);
        if (scan.hasNextInt()) {
            for (int i = 0; i < a.length; i++) {
                a[i] = scan.nextInt();
            }
        }
        int sum = 0;

        if (a[0] + a[1] <= a[2] * 2) {
            sum = a[0] * a[3] + a[1] * a[4];
        } else {
            if (a[3] >= a[4]) {
                sum = a[4] * 2 * a[2];
                sum = sum + (a[3] - a[4]) * a[0];
            } else {
                sum = a[3] * 2 * a[2];
                sum = sum + (a[4] - a[3]) * a[1];
            }

        }
        int sum1 = 0;
        if (a[3] >= a[4]) {
            sum1 = a[3] * a[2] * 2;
        }
        if (a[3] < a[4]) {
            sum1 = a[4] * a[2] * 2;
        }
        if (sum > sum1) {
            sum = sum1;
        }
        System.out.println(sum);
        scan.close();
    } main {
        int[] a = { 0, 0, 0, 0, 0 };
        Scanner scan = new Scanner(System.in);
        if (scan.hasNextInt()) {
            for (int i = 0; i < a.length; i++) {
                a[i] = scan.nextInt();
            }
        }
        int sum = 0;

        if (a[0] + a[1] <= a[2] * 2) {
            sum = a[0] * a[3] + a[1] * a[4];
        } else {
            if (a[3] >= a[4]) {
                sum = a[4] * 2 * a[2];
                sum = sum + (a[3] - a[4]) * a[0];
            } else {
                sum = a[3] * 2 * a[2];
                sum = sum + (a[4] - a[3]) * a[1];
            }

        }
        int sum1 = 0;
        if (a[3] >= a[4]) {
            sum1 = a[3] * a[2] * 2;
        }
        if (a[3] < a[4]) {
            sum1 = a[4] * a[2] * 2;
        }
        if (sum > sum1) {
            sum = sum1;
        }
        System.out.println(sum);
        scan.close();
    } int[] a = { 0, 0, 0, 0, 0 }; a { 0, 0, 0, 0, 0 } 0 0 0 0 0 Scanner scan = new Scanner(System.in); scan new Scanner(System.in) if (scan.hasNextInt()) {
            for (int i = 0; i < a.length; i++) {
                a[i] = scan.nextInt();
            }
        } scan.hasNextInt() scan.hasNextInt scan {
            for (int i = 0; i < a.length; i++) {
                a[i] = scan.nextInt();
            }
        } for (int i = 0; i < a.length; i++) {
                a[i] = scan.nextInt();
            } int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
                a[i] = scan.nextInt();
            } {
                a[i] = scan.nextInt();
            } a[i] = scan.nextInt() a[i] a i scan.nextInt() scan.nextInt scan int sum = 0; sum 0 if (a[0] + a[1] <= a[2] * 2) {
            sum = a[0] * a[3] + a[1] * a[4];
        } else {
            if (a[3] >= a[4]) {
                sum = a[4] * 2 * a[2];
                sum = sum + (a[3] - a[4]) * a[0];
            } else {
                sum = a[3] * 2 * a[2];
                sum = sum + (a[4] - a[3]) * a[1];
            }

        } a[0] + a[1] <= a[2] * 2 a[0] + a[1] a[0] a 0 a[1] a 1 a[2] * 2 a[2] a 2 2 {
            sum = a[0] * a[3] + a[1] * a[4];
        } sum = a[0] * a[3] + a[1] * a[4] sum a[0] * a[3] + a[1] * a[4] a[0] * a[3] a[0] a 0 a[3] a 3 a[1] * a[4] a[1] a 1 a[4] a 4 {
            if (a[3] >= a[4]) {
                sum = a[4] * 2 * a[2];
                sum = sum + (a[3] - a[4]) * a[0];
            } else {
                sum = a[3] * 2 * a[2];
                sum = sum + (a[4] - a[3]) * a[1];
            }

        } if (a[3] >= a[4]) {
                sum = a[4] * 2 * a[2];
                sum = sum + (a[3] - a[4]) * a[0];
            } else {
                sum = a[3] * 2 * a[2];
                sum = sum + (a[4] - a[3]) * a[1];
            } a[3] >= a[4] a[3] a 3 a[4] a 4 {
                sum = a[4] * 2 * a[2];
                sum = sum + (a[3] - a[4]) * a[0];
            } sum = a[4] * 2 * a[2] sum a[4] * 2 * a[2] a[4] * 2 * a[2] a[4] a 4 2 a[2] a 2 sum = sum + (a[3] - a[4]) * a[0] sum sum + (a[3] - a[4]) * a[0] sum (a[3] - a[4]) * a[0] (a[3] - a[4]) a[3] a 3 a[4] a 4 a[0] a 0 {
                sum = a[3] * 2 * a[2];
                sum = sum + (a[4] - a[3]) * a[1];
            } sum = a[3] * 2 * a[2] sum a[3] * 2 * a[2] a[3] * 2 * a[2] a[3] a 3 2 a[2] a 2 sum = sum + (a[4] - a[3]) * a[1] sum sum + (a[4] - a[3]) * a[1] sum (a[4] - a[3]) * a[1] (a[4] - a[3]) a[4] a 4 a[3] a 3 a[1] a 1 int sum1 = 0; sum1 0 if (a[3] >= a[4]) {
            sum1 = a[3] * a[2] * 2;
        } a[3] >= a[4] a[3] a 3 a[4] a 4 {
            sum1 = a[3] * a[2] * 2;
        } sum1 = a[3] * a[2] * 2 sum1 a[3] * a[2] * 2 a[3] * a[2] * 2 a[3] a 3 a[2] a 2 2 if (a[3] < a[4]) {
            sum1 = a[4] * a[2] * 2;
        } a[3] < a[4] a[3] a 3 a[4] a 4 {
            sum1 = a[4] * a[2] * 2;
        } sum1 = a[4] * a[2] * 2 sum1 a[4] * a[2] * 2 a[4] * a[2] * 2 a[4] a 4 a[2] a 2 2 if (sum > sum1) {
            sum = sum1;
        } sum > sum1 sum sum1 {
            sum = sum1;
        } sum = sum1 sum sum1 System.out.println(sum) System.out.println System.out System System.out sum scan.close() scan.close scan String[] args args public class Main {

    public static void main(String[] args) {
        int[] a = { 0, 0, 0, 0, 0 };
        Scanner scan = new Scanner(System.in);
        if (scan.hasNextInt()) {
            for (int i = 0; i < a.length; i++) {
                a[i] = scan.nextInt();
            }
        }
        int sum = 0;

        if (a[0] + a[1] <= a[2] * 2) {
            sum = a[0] * a[3] + a[1] * a[4];
        } else {
            if (a[3] >= a[4]) {
                sum = a[4] * 2 * a[2];
                sum = sum + (a[3] - a[4]) * a[0];
            } else {
                sum = a[3] * 2 * a[2];
                sum = sum + (a[4] - a[3]) * a[1];
            }

        }
        int sum1 = 0;
        if (a[3] >= a[4]) {
            sum1 = a[3] * a[2] * 2;
        }
        if (a[3] < a[4]) {
            sum1 = a[4] * a[2] * 2;
        }
        if (sum > sum1) {
            sum = sum1;
        }
        System.out.println(sum);
        scan.close();
    }
} public class Main {

    public static void main(String[] args) {
        int[] a = { 0, 0, 0, 0, 0 };
        Scanner scan = new Scanner(System.in);
        if (scan.hasNextInt()) {
            for (int i = 0; i < a.length; i++) {
                a[i] = scan.nextInt();
            }
        }
        int sum = 0;

        if (a[0] + a[1] <= a[2] * 2) {
            sum = a[0] * a[3] + a[1] * a[4];
        } else {
            if (a[3] >= a[4]) {
                sum = a[4] * 2 * a[2];
                sum = sum + (a[3] - a[4]) * a[0];
            } else {
                sum = a[3] * 2 * a[2];
                sum = sum + (a[4] - a[3]) * a[1];
            }

        }
        int sum1 = 0;
        if (a[3] >= a[4]) {
            sum1 = a[3] * a[2] * 2;
        }
        if (a[3] < a[4]) {
            sum1 = a[4] * a[2] * 2;
        }
        if (sum > sum1) {
            sum = sum1;
        }
        System.out.println(sum);
        scan.close();
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        int[] a = { 0, 0, 0, 0, 0 };
        Scanner scan = new Scanner(System.in);
        if (scan.hasNextInt()) {
            for (int i = 0; i < a.length; i++) {
                a[i] = scan.nextInt();
            }
        }
        int sum = 0;

        if (a[0] + a[1] <= a[2] * 2) {
            sum = a[0] * a[3] + a[1] * a[4];
        } else {
            if (a[3] >= a[4]) {
                sum = a[4] * 2 * a[2];
                sum = sum + (a[3] - a[4]) * a[0];
            } else {
                sum = a[3] * 2 * a[2];
                sum = sum + (a[4] - a[3]) * a[1];
            }

        }
        int sum1 = 0;
        if (a[3] >= a[4]) {
            sum1 = a[3] * a[2] * 2;
        }
        if (a[3] < a[4]) {
            sum1 = a[4] * a[2] * 2;
        }
        if (sum > sum1) {
            sum = sum1;
        }
        System.out.println(sum);
        scan.close();
    }
}