import java.util.Scanner;

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

        int A = scan.nextInt();
        int B = scan.nextInt();
        int AB = scan.nextInt();
        int x = scan.nextInt();
        int y = scan.nextInt();

        int ans = 1000000000;
        for(int i=0; i<2*(x+y)+1; i++){
            int ABpizza = i;
            int Apizza = Math.max(0,x - (i/2));
            int Bpizza = Math.max(0,y - (i/2));
            ans = Math.min(ans,(ABpizza*AB)+(Apizza*A)+(Bpizza*B));
        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);

        int A = scan.nextInt();
        int B = scan.nextInt();
        int AB = scan.nextInt();
        int x = scan.nextInt();
        int y = scan.nextInt();

        int ans = 1000000000;
        for(int i=0; i<2*(x+y)+1; i++){
            int ABpizza = i;
            int Apizza = Math.max(0,x - (i/2));
            int Bpizza = Math.max(0,y - (i/2));
            ans = Math.min(ans,(ABpizza*AB)+(Apizza*A)+(Bpizza*B));
        }
        System.out.println(ans);
    }
} Main public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);

        int A = scan.nextInt();
        int B = scan.nextInt();
        int AB = scan.nextInt();
        int x = scan.nextInt();
        int y = scan.nextInt();

        int ans = 1000000000;
        for(int i=0; i<2*(x+y)+1; i++){
            int ABpizza = i;
            int Apizza = Math.max(0,x - (i/2));
            int Bpizza = Math.max(0,y - (i/2));
            ans = Math.min(ans,(ABpizza*AB)+(Apizza*A)+(Bpizza*B));
        }
        System.out.println(ans);
    } main {
        Scanner scan = new Scanner(System.in);

        int A = scan.nextInt();
        int B = scan.nextInt();
        int AB = scan.nextInt();
        int x = scan.nextInt();
        int y = scan.nextInt();

        int ans = 1000000000;
        for(int i=0; i<2*(x+y)+1; i++){
            int ABpizza = i;
            int Apizza = Math.max(0,x - (i/2));
            int Bpizza = Math.max(0,y - (i/2));
            ans = Math.min(ans,(ABpizza*AB)+(Apizza*A)+(Bpizza*B));
        }
        System.out.println(ans);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int A = scan.nextInt(); A scan.nextInt() scan.nextInt scan int B = scan.nextInt(); B scan.nextInt() scan.nextInt scan int AB = scan.nextInt(); AB scan.nextInt() scan.nextInt scan int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan int y = scan.nextInt(); y scan.nextInt() scan.nextInt scan int ans = 1000000000; ans 1000000000 for(int i=0; i<2*(x+y)+1; i++){
            int ABpizza = i;
            int Apizza = Math.max(0,x - (i/2));
            int Bpizza = Math.max(0,y - (i/2));
            ans = Math.min(ans,(ABpizza*AB)+(Apizza*A)+(Bpizza*B));
        } int i=0; int i=0; i 0 i<2*(x+y)+1 i 2*(x+y)+1 2*(x+y) 2 (x+y) x y 1 i++ i++ i {
            int ABpizza = i;
            int Apizza = Math.max(0,x - (i/2));
            int Bpizza = Math.max(0,y - (i/2));
            ans = Math.min(ans,(ABpizza*AB)+(Apizza*A)+(Bpizza*B));
        } {
            int ABpizza = i;
            int Apizza = Math.max(0,x - (i/2));
            int Bpizza = Math.max(0,y - (i/2));
            ans = Math.min(ans,(ABpizza*AB)+(Apizza*A)+(Bpizza*B));
        } int ABpizza = i; ABpizza i int Apizza = Math.max(0,x - (i/2)); Apizza Math.max(0,x - (i/2)) Math.max Math 0 x - (i/2) x (i/2) i 2 int Bpizza = Math.max(0,y - (i/2)); Bpizza Math.max(0,y - (i/2)) Math.max Math 0 y - (i/2) y (i/2) i 2 ans = Math.min(ans,(ABpizza*AB)+(Apizza*A)+(Bpizza*B)) ans Math.min(ans,(ABpizza*AB)+(Apizza*A)+(Bpizza*B)) Math.min Math ans (ABpizza*AB)+(Apizza*A)+(Bpizza*B) (ABpizza*AB)+(Apizza*A)+(Bpizza*B) (ABpizza*AB) ABpizza AB (Apizza*A) Apizza A (Bpizza*B) Bpizza 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 scan = new Scanner(System.in);

        int A = scan.nextInt();
        int B = scan.nextInt();
        int AB = scan.nextInt();
        int x = scan.nextInt();
        int y = scan.nextInt();

        int ans = 1000000000;
        for(int i=0; i<2*(x+y)+1; i++){
            int ABpizza = i;
            int Apizza = Math.max(0,x - (i/2));
            int Bpizza = Math.max(0,y - (i/2));
            ans = Math.min(ans,(ABpizza*AB)+(Apizza*A)+(Bpizza*B));
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);

        int A = scan.nextInt();
        int B = scan.nextInt();
        int AB = scan.nextInt();
        int x = scan.nextInt();
        int y = scan.nextInt();

        int ans = 1000000000;
        for(int i=0; i<2*(x+y)+1; i++){
            int ABpizza = i;
            int Apizza = Math.max(0,x - (i/2));
            int Bpizza = Math.max(0,y - (i/2));
            ans = Math.min(ans,(ABpizza*AB)+(Apizza*A)+(Bpizza*B));
        }
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

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

        int A = scan.nextInt();
        int B = scan.nextInt();
        int AB = scan.nextInt();
        int x = scan.nextInt();
        int y = scan.nextInt();

        int ans = 1000000000;
        for(int i=0; i<2*(x+y)+1; i++){
            int ABpizza = i;
            int Apizza = Math.max(0,x - (i/2));
            int Bpizza = Math.max(0,y - (i/2));
            ans = Math.min(ans,(ABpizza*AB)+(Apizza*A)+(Bpizza*B));
        }
        System.out.println(ans);
    }
}