import java.lang.Math;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        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 answer = 0;
        if (A/2 + B/2 >= C) {
            if (X >= Y) {
                answer += C * Y * 2;  // 要求数が少ない方を先に充足させる
                if (A*(X-Y) < C*2*(X-Y)) {  // 要求数が多い方の要求数も, 少ない方の要求数だけ減っている
                    answer += A * (X-Y);
                }
                else {
                    answer += C*2 * (X-Y);
                }
            }
            else {
                answer += C * X * 2;
                if (B*(Y-X) < C*2*(Y-X)) {
                    answer += B * (Y-X);
                }
                else {
                    answer += C*2 * (Y-X);
                }
            }
        }
        else {
            answer += A * X + B * Y;
        }

        System.out.println(answer);
    }
} import java.lang.Math; Math java.lang import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        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 answer = 0;
        if (A/2 + B/2 >= C) {
            if (X >= Y) {
                answer += C * Y * 2;  // 要求数が少ない方を先に充足させる
                if (A*(X-Y) < C*2*(X-Y)) {  // 要求数が多い方の要求数も, 少ない方の要求数だけ減っている
                    answer += A * (X-Y);
                }
                else {
                    answer += C*2 * (X-Y);
                }
            }
            else {
                answer += C * X * 2;
                if (B*(Y-X) < C*2*(Y-X)) {
                    answer += B * (Y-X);
                }
                else {
                    answer += C*2 * (Y-X);
                }
            }
        }
        else {
            answer += A * X + B * Y;
        }

        System.out.println(answer);
    }
} Main public static void main(String[] args) {
        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 answer = 0;
        if (A/2 + B/2 >= C) {
            if (X >= Y) {
                answer += C * Y * 2;  // 要求数が少ない方を先に充足させる
                if (A*(X-Y) < C*2*(X-Y)) {  // 要求数が多い方の要求数も, 少ない方の要求数だけ減っている
                    answer += A * (X-Y);
                }
                else {
                    answer += C*2 * (X-Y);
                }
            }
            else {
                answer += C * X * 2;
                if (B*(Y-X) < C*2*(Y-X)) {
                    answer += B * (Y-X);
                }
                else {
                    answer += C*2 * (Y-X);
                }
            }
        }
        else {
            answer += A * X + B * Y;
        }

        System.out.println(answer);
    } 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 answer = 0;
        if (A/2 + B/2 >= C) {
            if (X >= Y) {
                answer += C * Y * 2;  // 要求数が少ない方を先に充足させる
                if (A*(X-Y) < C*2*(X-Y)) {  // 要求数が多い方の要求数も, 少ない方の要求数だけ減っている
                    answer += A * (X-Y);
                }
                else {
                    answer += C*2 * (X-Y);
                }
            }
            else {
                answer += C * X * 2;
                if (B*(Y-X) < C*2*(Y-X)) {
                    answer += B * (Y-X);
                }
                else {
                    answer += C*2 * (Y-X);
                }
            }
        }
        else {
            answer += A * X + B * Y;
        }

        System.out.println(answer);
    } 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 answer = 0; answer 0 if (A/2 + B/2 >= C) {
            if (X >= Y) {
                answer += C * Y * 2;  // 要求数が少ない方を先に充足させる
                if (A*(X-Y) < C*2*(X-Y)) {  // 要求数が多い方の要求数も, 少ない方の要求数だけ減っている
                    answer += A * (X-Y);
                }
                else {
                    answer += C*2 * (X-Y);
                }
            }
            else {
                answer += C * X * 2;
                if (B*(Y-X) < C*2*(Y-X)) {
                    answer += B * (Y-X);
                }
                else {
                    answer += C*2 * (Y-X);
                }
            }
        }
        else {
            answer += A * X + B * Y;
        } A/2 + B/2 >= C A/2 + B/2 A/2 A 2 B/2 B 2 C {
            if (X >= Y) {
                answer += C * Y * 2;  // 要求数が少ない方を先に充足させる
                if (A*(X-Y) < C*2*(X-Y)) {  // 要求数が多い方の要求数も, 少ない方の要求数だけ減っている
                    answer += A * (X-Y);
                }
                else {
                    answer += C*2 * (X-Y);
                }
            }
            else {
                answer += C * X * 2;
                if (B*(Y-X) < C*2*(Y-X)) {
                    answer += B * (Y-X);
                }
                else {
                    answer += C*2 * (Y-X);
                }
            }
        } if (X >= Y) {
                answer += C * Y * 2;  // 要求数が少ない方を先に充足させる
                if (A*(X-Y) < C*2*(X-Y)) {  // 要求数が多い方の要求数も, 少ない方の要求数だけ減っている
                    answer += A * (X-Y);
                }
                else {
                    answer += C*2 * (X-Y);
                }
            }
            else {
                answer += C * X * 2;
                if (B*(Y-X) < C*2*(Y-X)) {
                    answer += B * (Y-X);
                }
                else {
                    answer += C*2 * (Y-X);
                }
            } X >= Y X Y {
                answer += C * Y * 2;  // 要求数が少ない方を先に充足させる
                if (A*(X-Y) < C*2*(X-Y)) {  // 要求数が多い方の要求数も, 少ない方の要求数だけ減っている
                    answer += A * (X-Y);
                }
                else {
                    answer += C*2 * (X-Y);
                }
            } answer += C * Y * 2 answer C * Y * 2 C * Y * 2 C Y 2 if (A*(X-Y) < C*2*(X-Y)) {  // 要求数が多い方の要求数も, 少ない方の要求数だけ減っている
                    answer += A * (X-Y);
                }
                else {
                    answer += C*2 * (X-Y);
                } A*(X-Y) < C*2*(X-Y) A*(X-Y) A (X-Y) X Y C*2*(X-Y) C*2*(X-Y) C 2 (X-Y) X Y {  // 要求数が多い方の要求数も, 少ない方の要求数だけ減っている
                    answer += A * (X-Y);
                } answer += A * (X-Y) answer A * (X-Y) A (X-Y) X Y {
                    answer += C*2 * (X-Y);
                } answer += C*2 * (X-Y) answer C*2 * (X-Y) C*2 * (X-Y) C 2 (X-Y) X Y {
                answer += C * X * 2;
                if (B*(Y-X) < C*2*(Y-X)) {
                    answer += B * (Y-X);
                }
                else {
                    answer += C*2 * (Y-X);
                }
            } answer += C * X * 2 answer C * X * 2 C * X * 2 C X 2 if (B*(Y-X) < C*2*(Y-X)) {
                    answer += B * (Y-X);
                }
                else {
                    answer += C*2 * (Y-X);
                } B*(Y-X) < C*2*(Y-X) B*(Y-X) B (Y-X) Y X C*2*(Y-X) C*2*(Y-X) C 2 (Y-X) Y X {
                    answer += B * (Y-X);
                } answer += B * (Y-X) answer B * (Y-X) B (Y-X) Y X {
                    answer += C*2 * (Y-X);
                } answer += C*2 * (Y-X) answer C*2 * (Y-X) C*2 * (Y-X) C 2 (Y-X) Y X {
            answer += A * X + B * Y;
        } answer += A * X + B * Y answer A * X + B * Y A * X A X B * Y B Y System.out.println(answer) System.out.println System.out System System.out answer String[] args args
import java.lang.Math;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        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 answer = 0;
        if (A/2 + B/2 >= C) {
            if (X >= Y) {
                answer += C * Y * 2;  // 要求数が少ない方を先に充足させる
                if (A*(X-Y) < C*2*(X-Y)) {  // 要求数が多い方の要求数も, 少ない方の要求数だけ減っている
                    answer += A * (X-Y);
                }
                else {
                    answer += C*2 * (X-Y);
                }
            }
            else {
                answer += C * X * 2;
                if (B*(Y-X) < C*2*(Y-X)) {
                    answer += B * (Y-X);
                }
                else {
                    answer += C*2 * (Y-X);
                }
            }
        }
        else {
            answer += A * X + B * Y;
        }

        System.out.println(answer);
    }
}
