import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int A, B, C, X, Y;
        A = in.nextInt(); B = in.nextInt(); C = in.nextInt(); X = in.nextInt(); Y = in.nextInt();
       int sum = 0;
        while( X > 0 && Y > 0) {
            if(C * 2 < (A + B)) {
               sum += 2*C;
            } else {
                sum+= (A+B);
            }
            X--; Y--;
        }
        while(X > 0){
           if(A > (2*C)) sum+=(2*C);
           else sum+=A;

           X--;
        }

        while(Y > 0) {
            if(B > (2*C)) sum+=(2*C);
            else sum+=B;

            Y--;
        }
        System.out.println(sum);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int A, B, C, X, Y;
        A = in.nextInt(); B = in.nextInt(); C = in.nextInt(); X = in.nextInt(); Y = in.nextInt();
       int sum = 0;
        while( X > 0 && Y > 0) {
            if(C * 2 < (A + B)) {
               sum += 2*C;
            } else {
                sum+= (A+B);
            }
            X--; Y--;
        }
        while(X > 0){
           if(A > (2*C)) sum+=(2*C);
           else sum+=A;

           X--;
        }

        while(Y > 0) {
            if(B > (2*C)) sum+=(2*C);
            else sum+=B;

            Y--;
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int A, B, C, X, Y;
        A = in.nextInt(); B = in.nextInt(); C = in.nextInt(); X = in.nextInt(); Y = in.nextInt();
       int sum = 0;
        while( X > 0 && Y > 0) {
            if(C * 2 < (A + B)) {
               sum += 2*C;
            } else {
                sum+= (A+B);
            }
            X--; Y--;
        }
        while(X > 0){
           if(A > (2*C)) sum+=(2*C);
           else sum+=A;

           X--;
        }

        while(Y > 0) {
            if(B > (2*C)) sum+=(2*C);
            else sum+=B;

            Y--;
        }
        System.out.println(sum);
    } main {

        Scanner in = new Scanner(System.in);

        int A, B, C, X, Y;
        A = in.nextInt(); B = in.nextInt(); C = in.nextInt(); X = in.nextInt(); Y = in.nextInt();
       int sum = 0;
        while( X > 0 && Y > 0) {
            if(C * 2 < (A + B)) {
               sum += 2*C;
            } else {
                sum+= (A+B);
            }
            X--; Y--;
        }
        while(X > 0){
           if(A > (2*C)) sum+=(2*C);
           else sum+=A;

           X--;
        }

        while(Y > 0) {
            if(B > (2*C)) sum+=(2*C);
            else sum+=B;

            Y--;
        }
        System.out.println(sum);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int A A B B C C X X Y; Y A = in.nextInt() A in.nextInt() in.nextInt in B = in.nextInt() B in.nextInt() in.nextInt in C = in.nextInt() C in.nextInt() in.nextInt in X = in.nextInt() X in.nextInt() in.nextInt in Y = in.nextInt() Y in.nextInt() in.nextInt in int sum = 0; sum 0 while( X > 0 && Y > 0) {
            if(C * 2 < (A + B)) {
               sum += 2*C;
            } else {
                sum+= (A+B);
            }
            X--; Y--;
        } X > 0 && Y > 0 X > 0 X 0 Y > 0 Y 0 {
            if(C * 2 < (A + B)) {
               sum += 2*C;
            } else {
                sum+= (A+B);
            }
            X--; Y--;
        } if(C * 2 < (A + B)) {
               sum += 2*C;
            } else {
                sum+= (A+B);
            } C * 2 < (A + B) C * 2 C 2 (A + B) A B {
               sum += 2*C;
            } sum += 2*C sum 2*C 2 C {
                sum+= (A+B);
            } sum+= (A+B) sum (A+B) A B X-- X Y-- Y while(X > 0){
           if(A > (2*C)) sum+=(2*C);
           else sum+=A;

           X--;
        } X > 0 X 0 {
           if(A > (2*C)) sum+=(2*C);
           else sum+=A;

           X--;
        } if(A > (2*C)) sum+=(2*C);
           else sum+=A; A > (2*C) A (2*C) 2 C sum+=(2*C) sum (2*C) 2 C sum+=A sum A X-- X while(Y > 0) {
            if(B > (2*C)) sum+=(2*C);
            else sum+=B;

            Y--;
        } Y > 0 Y 0 {
            if(B > (2*C)) sum+=(2*C);
            else sum+=B;

            Y--;
        } if(B > (2*C)) sum+=(2*C);
            else sum+=B; B > (2*C) B (2*C) 2 C sum+=(2*C) sum (2*C) 2 C sum+=B sum B Y-- Y System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int A, B, C, X, Y;
        A = in.nextInt(); B = in.nextInt(); C = in.nextInt(); X = in.nextInt(); Y = in.nextInt();
       int sum = 0;
        while( X > 0 && Y > 0) {
            if(C * 2 < (A + B)) {
               sum += 2*C;
            } else {
                sum+= (A+B);
            }
            X--; Y--;
        }
        while(X > 0){
           if(A > (2*C)) sum+=(2*C);
           else sum+=A;

           X--;
        }

        while(Y > 0) {
            if(B > (2*C)) sum+=(2*C);
            else sum+=B;

            Y--;
        }
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int A, B, C, X, Y;
        A = in.nextInt(); B = in.nextInt(); C = in.nextInt(); X = in.nextInt(); Y = in.nextInt();
       int sum = 0;
        while( X > 0 && Y > 0) {
            if(C * 2 < (A + B)) {
               sum += 2*C;
            } else {
                sum+= (A+B);
            }
            X--; Y--;
        }
        while(X > 0){
           if(A > (2*C)) sum+=(2*C);
           else sum+=A;

           X--;
        }

        while(Y > 0) {
            if(B > (2*C)) sum+=(2*C);
            else sum+=B;

            Y--;
        }
        System.out.println(sum);
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int A, B, C, X, Y;
        A = in.nextInt(); B = in.nextInt(); C = in.nextInt(); X = in.nextInt(); Y = in.nextInt();
       int sum = 0;
        while( X > 0 && Y > 0) {
            if(C * 2 < (A + B)) {
               sum += 2*C;
            } else {
                sum+= (A+B);
            }
            X--; Y--;
        }
        while(X > 0){
           if(A > (2*C)) sum+=(2*C);
           else sum+=A;

           X--;
        }

        while(Y > 0) {
            if(B > (2*C)) sum+=(2*C);
            else sum+=B;

            Y--;
        }
        System.out.println(sum);
    }
}
