
import java.util.Scanner;

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

        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int X = sc.nextInt();
        int Y = sc.nextInt();

        int minValue = Integer.MAX_VALUE;
        // abピザでループ
        for (int i = 0; i <= 100000; i++) {
            // abピザ = C * 2 * i;
            int valueC = C * 2 * i;
            int remainX = Math.max(X - i, 0);
            int valueA = remainX * A;
            int remainY = Math.max(Y - i, 0);
            int valueB = remainY * B;

            minValue = Math.min(minValue, valueA + valueB + valueC);
        }

        System.out.println(minValue);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int X = sc.nextInt();
        int Y = sc.nextInt();

        int minValue = Integer.MAX_VALUE;
        // abピザでループ
        for (int i = 0; i <= 100000; i++) {
            // abピザ = C * 2 * i;
            int valueC = C * 2 * i;
            int remainX = Math.max(X - i, 0);
            int valueA = remainX * A;
            int remainY = Math.max(Y - i, 0);
            int valueB = remainY * B;

            minValue = Math.min(minValue, valueA + valueB + valueC);
        }

        System.out.println(minValue);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int X = sc.nextInt();
        int Y = sc.nextInt();

        int minValue = Integer.MAX_VALUE;
        // abピザでループ
        for (int i = 0; i <= 100000; i++) {
            // abピザ = C * 2 * i;
            int valueC = C * 2 * i;
            int remainX = Math.max(X - i, 0);
            int valueA = remainX * A;
            int remainY = Math.max(Y - i, 0);
            int valueB = remainY * B;

            minValue = Math.min(minValue, valueA + valueB + valueC);
        }

        System.out.println(minValue);
    } main {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int X = sc.nextInt();
        int Y = sc.nextInt();

        int minValue = Integer.MAX_VALUE;
        // abピザでループ
        for (int i = 0; i <= 100000; i++) {
            // abピザ = C * 2 * i;
            int valueC = C * 2 * i;
            int remainX = Math.max(X - i, 0);
            int valueA = remainX * A;
            int remainY = Math.max(Y - i, 0);
            int valueB = remainY * B;

            minValue = Math.min(minValue, valueA + valueB + valueC);
        }

        System.out.println(minValue);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int C = sc.nextInt(); C sc.nextInt() sc.nextInt sc int X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int Y = sc.nextInt(); Y sc.nextInt() sc.nextInt sc int minValue = Integer.MAX_VALUE; minValue Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0; i <= 100000; i++) {
            // abピザ = C * 2 * i;
            int valueC = C * 2 * i;
            int remainX = Math.max(X - i, 0);
            int valueA = remainX * A;
            int remainY = Math.max(Y - i, 0);
            int valueB = remainY * B;

            minValue = Math.min(minValue, valueA + valueB + valueC);
        } int i = 0; int i = 0; i 0 i <= 100000 i 100000 i++ i++ i {
            // abピザ = C * 2 * i;
            int valueC = C * 2 * i;
            int remainX = Math.max(X - i, 0);
            int valueA = remainX * A;
            int remainY = Math.max(Y - i, 0);
            int valueB = remainY * B;

            minValue = Math.min(minValue, valueA + valueB + valueC);
        } {
            // abピザ = C * 2 * i;
            int valueC = C * 2 * i;
            int remainX = Math.max(X - i, 0);
            int valueA = remainX * A;
            int remainY = Math.max(Y - i, 0);
            int valueB = remainY * B;

            minValue = Math.min(minValue, valueA + valueB + valueC);
        } int valueC = C * 2 * i; valueC C * 2 * i C * 2 * i C 2 i int remainX = Math.max(X - i, 0); remainX Math.max(X - i, 0) Math.max Math X - i X i 0 int valueA = remainX * A; valueA remainX * A remainX A int remainY = Math.max(Y - i, 0); remainY Math.max(Y - i, 0) Math.max Math Y - i Y i 0 int valueB = remainY * B; valueB remainY * B remainY B minValue = Math.min(minValue, valueA + valueB + valueC) minValue Math.min(minValue, valueA + valueB + valueC) Math.min Math minValue valueA + valueB + valueC valueA + valueB + valueC valueA valueB valueC System.out.println(minValue) System.out.println System.out System System.out minValue String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int X = sc.nextInt();
        int Y = sc.nextInt();

        int minValue = Integer.MAX_VALUE;
        // abピザでループ
        for (int i = 0; i <= 100000; i++) {
            // abピザ = C * 2 * i;
            int valueC = C * 2 * i;
            int remainX = Math.max(X - i, 0);
            int valueA = remainX * A;
            int remainY = Math.max(Y - i, 0);
            int valueB = remainY * B;

            minValue = Math.min(minValue, valueA + valueB + valueC);
        }

        System.out.println(minValue);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int X = sc.nextInt();
        int Y = sc.nextInt();

        int minValue = Integer.MAX_VALUE;
        // abピザでループ
        for (int i = 0; i <= 100000; i++) {
            // abピザ = C * 2 * i;
            int valueC = C * 2 * i;
            int remainX = Math.max(X - i, 0);
            int valueA = remainX * A;
            int remainY = Math.max(Y - i, 0);
            int valueB = remainY * B;

            minValue = Math.min(minValue, valueA + valueB + valueC);
        }

        System.out.println(minValue);
    }
} Main

import java.util.Scanner;

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

        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int X = sc.nextInt();
        int Y = sc.nextInt();

        int minValue = Integer.MAX_VALUE;
        // abピザでループ
        for (int i = 0; i <= 100000; i++) {
            // abピザ = C * 2 * i;
            int valueC = C * 2 * i;
            int remainX = Math.max(X - i, 0);
            int valueA = remainX * A;
            int remainY = Math.max(Y - i, 0);
            int valueB = remainY * B;

            minValue = Math.min(minValue, valueA + valueB + valueC);
        }

        System.out.println(minValue);
    }
}