

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();
            int ans = Integer.MAX_VALUE;
            for (int i = 0; i <= Math.max(x, y) * 2; i++) {
                int remX = Math.max(0, x - i / 2);
                int remY = Math.max(0, y - i / 2);

                ans = Math.min(ans, c * i + remX * a + remY * b);
            }
            System.out.println(ans);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();
            int ans = Integer.MAX_VALUE;
            for (int i = 0; i <= Math.max(x, y) * 2; i++) {
                int remX = Math.max(0, x - i / 2);
                int remY = Math.max(0, y - i / 2);

                ans = Math.min(ans, c * i + remX * a + remY * b);
            }
            System.out.println(ans);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();
            int ans = Integer.MAX_VALUE;
            for (int i = 0; i <= Math.max(x, y) * 2; i++) {
                int remX = Math.max(0, x - i / 2);
                int remY = Math.max(0, y - i / 2);

                ans = Math.min(ans, c * i + remX * a + remY * b);
            }
            System.out.println(ans);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();
            int ans = Integer.MAX_VALUE;
            for (int i = 0; i <= Math.max(x, y) * 2; i++) {
                int remX = Math.max(0, x - i / 2);
                int remY = Math.max(0, y - i / 2);

                ans = Math.min(ans, c * i + remX * a + remY * b);
            }
            System.out.println(ans);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (sc.hasNextInt()) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();
            int ans = Integer.MAX_VALUE;
            for (int i = 0; i <= Math.max(x, y) * 2; i++) {
                int remX = Math.max(0, x - i / 2);
                int remY = Math.max(0, y - i / 2);

                ans = Math.min(ans, c * i + remX * a + remY * b);
            }
            System.out.println(ans);
        } sc.hasNextInt() sc.hasNextInt sc {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();
            int ans = Integer.MAX_VALUE;
            for (int i = 0; i <= Math.max(x, y) * 2; i++) {
                int remX = Math.max(0, x - i / 2);
                int remY = Math.max(0, y - i / 2);

                ans = Math.min(ans, c * i + remX * a + remY * b);
            }
            System.out.println(ans);
        } 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 ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0; i <= Math.max(x, y) * 2; i++) {
                int remX = Math.max(0, x - i / 2);
                int remY = Math.max(0, y - i / 2);

                ans = Math.min(ans, c * i + remX * a + remY * b);
            } int i = 0; int i = 0; i 0 i <= Math.max(x, y) * 2 i Math.max(x, y) * 2 Math.max(x, y) Math.max Math x y 2 i++ i++ i {
                int remX = Math.max(0, x - i / 2);
                int remY = Math.max(0, y - i / 2);

                ans = Math.min(ans, c * i + remX * a + remY * b);
            } {
                int remX = Math.max(0, x - i / 2);
                int remY = Math.max(0, y - i / 2);

                ans = Math.min(ans, c * i + remX * a + remY * b);
            } int remX = Math.max(0, x - i / 2); remX Math.max(0, x - i / 2) Math.max Math 0 x - i / 2 x i / 2 i 2 int remY = Math.max(0, y - i / 2); remY Math.max(0, y - i / 2) Math.max Math 0 y - i / 2 y i / 2 i 2 ans = Math.min(ans, c * i + remX * a + remY * b) ans Math.min(ans, c * i + remX * a + remY * b) Math.min Math ans c * i + remX * a + remY * b c * i + remX * a + remY * b c * i c i remX * a remX a remY * b remY b System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();
            int ans = Integer.MAX_VALUE;
            for (int i = 0; i <= Math.max(x, y) * 2; i++) {
                int remX = Math.max(0, x - i / 2);
                int remY = Math.max(0, y - i / 2);

                ans = Math.min(ans, c * i + remX * a + remY * b);
            }
            System.out.println(ans);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();
            int ans = Integer.MAX_VALUE;
            for (int i = 0; i <= Math.max(x, y) * 2; i++) {
                int remX = Math.max(0, x - i / 2);
                int remY = Math.max(0, y - i / 2);

                ans = Math.min(ans, c * i + remX * a + remY * b);
            }
            System.out.println(ans);
        }
    }
} Main


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();
            int ans = Integer.MAX_VALUE;
            for (int i = 0; i <= Math.max(x, y) * 2; i++) {
                int remX = Math.max(0, x - i / 2);
                int remY = Math.max(0, y - i / 2);

                ans = Math.min(ans, c * i + remX * a + remY * b);
            }
            System.out.println(ans);
        }
    }
}
