import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.util.*;

public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        int aCost = sc.nextInt();
        int bCost = sc.nextInt();
        int abCost = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int sum1 = 0;
        int sum2 = 0;
        int sum3 = 0;
        int sum4 = 0;
        int sum5 = 0;

        if(A == B){
            sum1 += abCost*A*2;
            sum2 += abCost*A*2;
            sum3 += abCost*A*2;
            sum4 += abCost*A*2;
            sum5 += abCost*A*2;
        } else {
            sum1 += bCost*B + aCost*A;
            if(A-B < 0){
                sum2 += abCost*B*2;
                sum3 += abCost*B*2;
            } else {
                sum2 += abCost*B*2 + aCost*(A-B);
                sum3 += abCost*B*2 + aCost*(A-B);
            }

            if(B-A < 0){
                sum4 += abCost*A*2;
                sum5 += abCost*A*2;
            } else {
                sum4 += abCost*A*2 + bCost*(B-A);
                sum5 += abCost*A*2 + bCost*(B-A);
            }

        }

        int min = Math.min(sum1, sum2);
        min = Math.min(min, sum3);
        min = Math.min(min, sum4);
        min = Math.min(min, sum5);

        System.out.println(min);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.math.BigDecimal; BigDecimal java.math import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset import java.util.*; util.* java public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        int aCost = sc.nextInt();
        int bCost = sc.nextInt();
        int abCost = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int sum1 = 0;
        int sum2 = 0;
        int sum3 = 0;
        int sum4 = 0;
        int sum5 = 0;

        if(A == B){
            sum1 += abCost*A*2;
            sum2 += abCost*A*2;
            sum3 += abCost*A*2;
            sum4 += abCost*A*2;
            sum5 += abCost*A*2;
        } else {
            sum1 += bCost*B + aCost*A;
            if(A-B < 0){
                sum2 += abCost*B*2;
                sum3 += abCost*B*2;
            } else {
                sum2 += abCost*B*2 + aCost*(A-B);
                sum3 += abCost*B*2 + aCost*(A-B);
            }

            if(B-A < 0){
                sum4 += abCost*A*2;
                sum5 += abCost*A*2;
            } else {
                sum4 += abCost*A*2 + bCost*(B-A);
                sum5 += abCost*A*2 + bCost*(B-A);
            }

        }

        int min = Math.min(sum1, sum2);
        min = Math.min(min, sum3);
        min = Math.min(min, sum4);
        min = Math.min(min, sum5);

        System.out.println(min);
    }
} Main public static void main(String[] args) throws IOException {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {
        Scanner sc = new Scanner(System.in);
        int aCost = sc.nextInt();
        int bCost = sc.nextInt();
        int abCost = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int sum1 = 0;
        int sum2 = 0;
        int sum3 = 0;
        int sum4 = 0;
        int sum5 = 0;

        if(A == B){
            sum1 += abCost*A*2;
            sum2 += abCost*A*2;
            sum3 += abCost*A*2;
            sum4 += abCost*A*2;
            sum5 += abCost*A*2;
        } else {
            sum1 += bCost*B + aCost*A;
            if(A-B < 0){
                sum2 += abCost*B*2;
                sum3 += abCost*B*2;
            } else {
                sum2 += abCost*B*2 + aCost*(A-B);
                sum3 += abCost*B*2 + aCost*(A-B);
            }

            if(B-A < 0){
                sum4 += abCost*A*2;
                sum5 += abCost*A*2;
            } else {
                sum4 += abCost*A*2 + bCost*(B-A);
                sum5 += abCost*A*2 + bCost*(B-A);
            }

        }

        int min = Math.min(sum1, sum2);
        min = Math.min(min, sum3);
        min = Math.min(min, sum4);
        min = Math.min(min, sum5);

        System.out.println(min);
    } run {
        Scanner sc = new Scanner(System.in);
        int aCost = sc.nextInt();
        int bCost = sc.nextInt();
        int abCost = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int sum1 = 0;
        int sum2 = 0;
        int sum3 = 0;
        int sum4 = 0;
        int sum5 = 0;

        if(A == B){
            sum1 += abCost*A*2;
            sum2 += abCost*A*2;
            sum3 += abCost*A*2;
            sum4 += abCost*A*2;
            sum5 += abCost*A*2;
        } else {
            sum1 += bCost*B + aCost*A;
            if(A-B < 0){
                sum2 += abCost*B*2;
                sum3 += abCost*B*2;
            } else {
                sum2 += abCost*B*2 + aCost*(A-B);
                sum3 += abCost*B*2 + aCost*(A-B);
            }

            if(B-A < 0){
                sum4 += abCost*A*2;
                sum5 += abCost*A*2;
            } else {
                sum4 += abCost*A*2 + bCost*(B-A);
                sum5 += abCost*A*2 + bCost*(B-A);
            }

        }

        int min = Math.min(sum1, sum2);
        min = Math.min(min, sum3);
        min = Math.min(min, sum4);
        min = Math.min(min, sum5);

        System.out.println(min);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int aCost = sc.nextInt(); aCost sc.nextInt() sc.nextInt sc int bCost = sc.nextInt(); bCost sc.nextInt() sc.nextInt sc int abCost = sc.nextInt(); abCost sc.nextInt() sc.nextInt sc int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int sum1 = 0; sum1 0 int sum2 = 0; sum2 0 int sum3 = 0; sum3 0 int sum4 = 0; sum4 0 int sum5 = 0; sum5 0 if(A == B){
            sum1 += abCost*A*2;
            sum2 += abCost*A*2;
            sum3 += abCost*A*2;
            sum4 += abCost*A*2;
            sum5 += abCost*A*2;
        } else {
            sum1 += bCost*B + aCost*A;
            if(A-B < 0){
                sum2 += abCost*B*2;
                sum3 += abCost*B*2;
            } else {
                sum2 += abCost*B*2 + aCost*(A-B);
                sum3 += abCost*B*2 + aCost*(A-B);
            }

            if(B-A < 0){
                sum4 += abCost*A*2;
                sum5 += abCost*A*2;
            } else {
                sum4 += abCost*A*2 + bCost*(B-A);
                sum5 += abCost*A*2 + bCost*(B-A);
            }

        } A == B A B {
            sum1 += abCost*A*2;
            sum2 += abCost*A*2;
            sum3 += abCost*A*2;
            sum4 += abCost*A*2;
            sum5 += abCost*A*2;
        } sum1 += abCost*A*2 sum1 abCost*A*2 abCost*A*2 abCost A 2 sum2 += abCost*A*2 sum2 abCost*A*2 abCost*A*2 abCost A 2 sum3 += abCost*A*2 sum3 abCost*A*2 abCost*A*2 abCost A 2 sum4 += abCost*A*2 sum4 abCost*A*2 abCost*A*2 abCost A 2 sum5 += abCost*A*2 sum5 abCost*A*2 abCost*A*2 abCost A 2 {
            sum1 += bCost*B + aCost*A;
            if(A-B < 0){
                sum2 += abCost*B*2;
                sum3 += abCost*B*2;
            } else {
                sum2 += abCost*B*2 + aCost*(A-B);
                sum3 += abCost*B*2 + aCost*(A-B);
            }

            if(B-A < 0){
                sum4 += abCost*A*2;
                sum5 += abCost*A*2;
            } else {
                sum4 += abCost*A*2 + bCost*(B-A);
                sum5 += abCost*A*2 + bCost*(B-A);
            }

        } sum1 += bCost*B + aCost*A sum1 bCost*B + aCost*A bCost*B bCost B aCost*A aCost A if(A-B < 0){
                sum2 += abCost*B*2;
                sum3 += abCost*B*2;
            } else {
                sum2 += abCost*B*2 + aCost*(A-B);
                sum3 += abCost*B*2 + aCost*(A-B);
            } A-B < 0 A-B A B 0 {
                sum2 += abCost*B*2;
                sum3 += abCost*B*2;
            } sum2 += abCost*B*2 sum2 abCost*B*2 abCost*B*2 abCost B 2 sum3 += abCost*B*2 sum3 abCost*B*2 abCost*B*2 abCost B 2 {
                sum2 += abCost*B*2 + aCost*(A-B);
                sum3 += abCost*B*2 + aCost*(A-B);
            } sum2 += abCost*B*2 + aCost*(A-B) sum2 abCost*B*2 + aCost*(A-B) abCost*B*2 abCost*B*2 abCost B 2 aCost*(A-B) aCost (A-B) A B sum3 += abCost*B*2 + aCost*(A-B) sum3 abCost*B*2 + aCost*(A-B) abCost*B*2 abCost*B*2 abCost B 2 aCost*(A-B) aCost (A-B) A B if(B-A < 0){
                sum4 += abCost*A*2;
                sum5 += abCost*A*2;
            } else {
                sum4 += abCost*A*2 + bCost*(B-A);
                sum5 += abCost*A*2 + bCost*(B-A);
            } B-A < 0 B-A B A 0 {
                sum4 += abCost*A*2;
                sum5 += abCost*A*2;
            } sum4 += abCost*A*2 sum4 abCost*A*2 abCost*A*2 abCost A 2 sum5 += abCost*A*2 sum5 abCost*A*2 abCost*A*2 abCost A 2 {
                sum4 += abCost*A*2 + bCost*(B-A);
                sum5 += abCost*A*2 + bCost*(B-A);
            } sum4 += abCost*A*2 + bCost*(B-A) sum4 abCost*A*2 + bCost*(B-A) abCost*A*2 abCost*A*2 abCost A 2 bCost*(B-A) bCost (B-A) B A sum5 += abCost*A*2 + bCost*(B-A) sum5 abCost*A*2 + bCost*(B-A) abCost*A*2 abCost*A*2 abCost A 2 bCost*(B-A) bCost (B-A) B A int min = Math.min(sum1, sum2); min Math.min(sum1, sum2) Math.min Math sum1 sum2 min = Math.min(min, sum3) min Math.min(min, sum3) Math.min Math min sum3 min = Math.min(min, sum4) min Math.min(min, sum4) Math.min Math min sum4 min = Math.min(min, sum5) min Math.min(min, sum5) Math.min Math min sum5 System.out.println(min) System.out.println System.out System System.out min public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        int aCost = sc.nextInt();
        int bCost = sc.nextInt();
        int abCost = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int sum1 = 0;
        int sum2 = 0;
        int sum3 = 0;
        int sum4 = 0;
        int sum5 = 0;

        if(A == B){
            sum1 += abCost*A*2;
            sum2 += abCost*A*2;
            sum3 += abCost*A*2;
            sum4 += abCost*A*2;
            sum5 += abCost*A*2;
        } else {
            sum1 += bCost*B + aCost*A;
            if(A-B < 0){
                sum2 += abCost*B*2;
                sum3 += abCost*B*2;
            } else {
                sum2 += abCost*B*2 + aCost*(A-B);
                sum3 += abCost*B*2 + aCost*(A-B);
            }

            if(B-A < 0){
                sum4 += abCost*A*2;
                sum5 += abCost*A*2;
            } else {
                sum4 += abCost*A*2 + bCost*(B-A);
                sum5 += abCost*A*2 + bCost*(B-A);
            }

        }

        int min = Math.min(sum1, sum2);
        min = Math.min(min, sum3);
        min = Math.min(min, sum4);
        min = Math.min(min, sum5);

        System.out.println(min);
    }
} public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        int aCost = sc.nextInt();
        int bCost = sc.nextInt();
        int abCost = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int sum1 = 0;
        int sum2 = 0;
        int sum3 = 0;
        int sum4 = 0;
        int sum5 = 0;

        if(A == B){
            sum1 += abCost*A*2;
            sum2 += abCost*A*2;
            sum3 += abCost*A*2;
            sum4 += abCost*A*2;
            sum5 += abCost*A*2;
        } else {
            sum1 += bCost*B + aCost*A;
            if(A-B < 0){
                sum2 += abCost*B*2;
                sum3 += abCost*B*2;
            } else {
                sum2 += abCost*B*2 + aCost*(A-B);
                sum3 += abCost*B*2 + aCost*(A-B);
            }

            if(B-A < 0){
                sum4 += abCost*A*2;
                sum5 += abCost*A*2;
            } else {
                sum4 += abCost*A*2 + bCost*(B-A);
                sum5 += abCost*A*2 + bCost*(B-A);
            }

        }

        int min = Math.min(sum1, sum2);
        min = Math.min(min, sum3);
        min = Math.min(min, sum4);
        min = Math.min(min, sum5);

        System.out.println(min);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.util.*;

public class Main {

    //グローバル変数を定義

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        int aCost = sc.nextInt();
        int bCost = sc.nextInt();
        int abCost = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();

        int sum1 = 0;
        int sum2 = 0;
        int sum3 = 0;
        int sum4 = 0;
        int sum5 = 0;

        if(A == B){
            sum1 += abCost*A*2;
            sum2 += abCost*A*2;
            sum3 += abCost*A*2;
            sum4 += abCost*A*2;
            sum5 += abCost*A*2;
        } else {
            sum1 += bCost*B + aCost*A;
            if(A-B < 0){
                sum2 += abCost*B*2;
                sum3 += abCost*B*2;
            } else {
                sum2 += abCost*B*2 + aCost*(A-B);
                sum3 += abCost*B*2 + aCost*(A-B);
            }

            if(B-A < 0){
                sum4 += abCost*A*2;
                sum5 += abCost*A*2;
            } else {
                sum4 += abCost*A*2 + bCost*(B-A);
                sum5 += abCost*A*2 + bCost*(B-A);
            }

        }

        int min = Math.min(sum1, sum2);
        min = Math.min(min, sum3);
        min = Math.min(min, sum4);
        min = Math.min(min, sum5);

        System.out.println(min);
    }
}
