
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

// ABC095 at 2018/04/24

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solveC();
    }

    private void solveA() {
        Scanner sc = new Scanner(System.in);
        char[] N = sc.nextLine().toCharArray();
        int result = 700;
        for (char c : N) {
            if ("o".equals(String.valueOf(c))) {
                result += 100;
            }
        }
        System.out.println(result);
    }

    private void solveB() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int X = sc.nextInt();
        int cnt = 0;
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            list.add(sc.nextInt());
        }
        for (Integer integer : list) {
            X -= integer;
            cnt++;
        }

        Collections.sort(list);
        int min = list.get(0);
        while(min <= X) {
            X -= min;
            cnt++;
        }
        System.out.println(cnt);

    }

    // ABC095 at 2018/04/29
    private void solveC() {
        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 sum = 0;
        if (C * 2 < A + B) {
            sum += C * 2 * Math.min(X, Y);
            if (Math.max(X, Y) == X) {
                if (C * 2 * (X - Y) <  (X - Y) * A) {
                    sum += C * 2 * (X - Y);
                } else {
                    sum += (X - Y) * A;
                }
            } else {
                if (C * 2 * (Y - X) < (Y - X) * B) {
                    sum += C * 2 * (Y - X);
                } else {
                    sum += (Y - X) * B;
                }
            }
        } else {
            sum += X * A + Y * B;
        }
        System.out.println(sum);
    }

    private void solveD() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveE() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveF() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solveC();
    }

    private void solveA() {
        Scanner sc = new Scanner(System.in);
        char[] N = sc.nextLine().toCharArray();
        int result = 700;
        for (char c : N) {
            if ("o".equals(String.valueOf(c))) {
                result += 100;
            }
        }
        System.out.println(result);
    }

    private void solveB() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int X = sc.nextInt();
        int cnt = 0;
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            list.add(sc.nextInt());
        }
        for (Integer integer : list) {
            X -= integer;
            cnt++;
        }

        Collections.sort(list);
        int min = list.get(0);
        while(min <= X) {
            X -= min;
            cnt++;
        }
        System.out.println(cnt);

    }

    // ABC095 at 2018/04/29
    private void solveC() {
        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 sum = 0;
        if (C * 2 < A + B) {
            sum += C * 2 * Math.min(X, Y);
            if (Math.max(X, Y) == X) {
                if (C * 2 * (X - Y) <  (X - Y) * A) {
                    sum += C * 2 * (X - Y);
                } else {
                    sum += (X - Y) * A;
                }
            } else {
                if (C * 2 * (Y - X) < (Y - X) * B) {
                    sum += C * 2 * (Y - X);
                } else {
                    sum += (Y - X) * B;
                }
            }
        } else {
            sum += X * A + Y * B;
        }
        System.out.println(sum);
    }

    private void solveD() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveE() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveF() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

} Main public static void main(String[] args) {
        Main main = new Main();
        main.solveC();
    } main {
        Main main = new Main();
        main.solveC();
    } Main main = new Main(); main new Main() main.solveC() main.solveC main String[] args args private void solveA() {
        Scanner sc = new Scanner(System.in);
        char[] N = sc.nextLine().toCharArray();
        int result = 700;
        for (char c : N) {
            if ("o".equals(String.valueOf(c))) {
                result += 100;
            }
        }
        System.out.println(result);
    } solveA {
        Scanner sc = new Scanner(System.in);
        char[] N = sc.nextLine().toCharArray();
        int result = 700;
        for (char c : N) {
            if ("o".equals(String.valueOf(c))) {
                result += 100;
            }
        }
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] N = sc.nextLine().toCharArray(); N sc.nextLine().toCharArray() sc.nextLine().toCharArray sc.nextLine() sc.nextLine sc int result = 700; result 700 for (char c : N) {
            if ("o".equals(String.valueOf(c))) {
                result += 100;
            }
        } char c N {
            if ("o".equals(String.valueOf(c))) {
                result += 100;
            }
        } {
            if ("o".equals(String.valueOf(c))) {
                result += 100;
            }
        } if ("o".equals(String.valueOf(c))) {
                result += 100;
            } "o".equals(String.valueOf(c)) "o".equals "o" String.valueOf(c) String.valueOf String c {
                result += 100;
            } result += 100 result 100 System.out.println(result) System.out.println System.out System System.out result private void solveB() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int X = sc.nextInt();
        int cnt = 0;
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            list.add(sc.nextInt());
        }
        for (Integer integer : list) {
            X -= integer;
            cnt++;
        }

        Collections.sort(list);
        int min = list.get(0);
        while(min <= X) {
            X -= min;
            cnt++;
        }
        System.out.println(cnt);

    } solveB {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int X = sc.nextInt();
        int cnt = 0;
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            list.add(sc.nextInt());
        }
        for (Integer integer : list) {
            X -= integer;
            cnt++;
        }

        Collections.sort(list);
        int min = list.get(0);
        while(min <= X) {
            X -= min;
            cnt++;
        }
        System.out.println(cnt);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int cnt = 0; cnt 0 ArrayList<Integer> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < N; i++) {
            list.add(sc.nextInt());
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            list.add(sc.nextInt());
        } {
            list.add(sc.nextInt());
        } list.add(sc.nextInt()) list.add list sc.nextInt() sc.nextInt sc for (Integer integer : list) {
            X -= integer;
            cnt++;
        } Integer integer list {
            X -= integer;
            cnt++;
        } {
            X -= integer;
            cnt++;
        } X -= integer X integer cnt++ cnt Collections.sort(list) Collections.sort Collections list int min = list.get(0); min list.get(0) list.get list 0 while(min <= X) {
            X -= min;
            cnt++;
        } min <= X min X {
            X -= min;
            cnt++;
        } X -= min X min cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt // ABC095 at 2018/04/29
    private void solveC() {
        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 sum = 0;
        if (C * 2 < A + B) {
            sum += C * 2 * Math.min(X, Y);
            if (Math.max(X, Y) == X) {
                if (C * 2 * (X - Y) <  (X - Y) * A) {
                    sum += C * 2 * (X - Y);
                } else {
                    sum += (X - Y) * A;
                }
            } else {
                if (C * 2 * (Y - X) < (Y - X) * B) {
                    sum += C * 2 * (Y - X);
                } else {
                    sum += (Y - X) * B;
                }
            }
        } else {
            sum += X * A + Y * B;
        }
        System.out.println(sum);
    } solveC {
        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 sum = 0;
        if (C * 2 < A + B) {
            sum += C * 2 * Math.min(X, Y);
            if (Math.max(X, Y) == X) {
                if (C * 2 * (X - Y) <  (X - Y) * A) {
                    sum += C * 2 * (X - Y);
                } else {
                    sum += (X - Y) * A;
                }
            } else {
                if (C * 2 * (Y - X) < (Y - X) * B) {
                    sum += C * 2 * (Y - X);
                } else {
                    sum += (Y - X) * B;
                }
            }
        } else {
            sum += X * A + Y * B;
        }
        System.out.println(sum);
    } 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 sum = 0; sum 0 if (C * 2 < A + B) {
            sum += C * 2 * Math.min(X, Y);
            if (Math.max(X, Y) == X) {
                if (C * 2 * (X - Y) <  (X - Y) * A) {
                    sum += C * 2 * (X - Y);
                } else {
                    sum += (X - Y) * A;
                }
            } else {
                if (C * 2 * (Y - X) < (Y - X) * B) {
                    sum += C * 2 * (Y - X);
                } else {
                    sum += (Y - X) * B;
                }
            }
        } else {
            sum += X * A + Y * B;
        } C * 2 < A + B C * 2 C 2 A + B A B {
            sum += C * 2 * Math.min(X, Y);
            if (Math.max(X, Y) == X) {
                if (C * 2 * (X - Y) <  (X - Y) * A) {
                    sum += C * 2 * (X - Y);
                } else {
                    sum += (X - Y) * A;
                }
            } else {
                if (C * 2 * (Y - X) < (Y - X) * B) {
                    sum += C * 2 * (Y - X);
                } else {
                    sum += (Y - X) * B;
                }
            }
        } sum += C * 2 * Math.min(X, Y) sum C * 2 * Math.min(X, Y) C * 2 * Math.min(X, Y) C 2 Math.min(X, Y) Math.min Math X Y if (Math.max(X, Y) == X) {
                if (C * 2 * (X - Y) <  (X - Y) * A) {
                    sum += C * 2 * (X - Y);
                } else {
                    sum += (X - Y) * A;
                }
            } else {
                if (C * 2 * (Y - X) < (Y - X) * B) {
                    sum += C * 2 * (Y - X);
                } else {
                    sum += (Y - X) * B;
                }
            } Math.max(X, Y) == X Math.max(X, Y) Math.max Math X Y X {
                if (C * 2 * (X - Y) <  (X - Y) * A) {
                    sum += C * 2 * (X - Y);
                } else {
                    sum += (X - Y) * A;
                }
            } if (C * 2 * (X - Y) <  (X - Y) * A) {
                    sum += C * 2 * (X - Y);
                } else {
                    sum += (X - Y) * A;
                } C * 2 * (X - Y) <  (X - Y) * A C * 2 * (X - Y) C * 2 * (X - Y) C 2 (X - Y) X Y (X - Y) * A (X - Y) X Y A {
                    sum += C * 2 * (X - Y);
                } sum += C * 2 * (X - Y) sum C * 2 * (X - Y) C * 2 * (X - Y) C 2 (X - Y) X Y {
                    sum += (X - Y) * A;
                } sum += (X - Y) * A sum (X - Y) * A (X - Y) X Y A {
                if (C * 2 * (Y - X) < (Y - X) * B) {
                    sum += C * 2 * (Y - X);
                } else {
                    sum += (Y - X) * B;
                }
            } if (C * 2 * (Y - X) < (Y - X) * B) {
                    sum += C * 2 * (Y - X);
                } else {
                    sum += (Y - X) * B;
                } C * 2 * (Y - X) < (Y - X) * B C * 2 * (Y - X) C * 2 * (Y - X) C 2 (Y - X) Y X (Y - X) * B (Y - X) Y X B {
                    sum += C * 2 * (Y - X);
                } sum += C * 2 * (Y - X) sum C * 2 * (Y - X) C * 2 * (Y - X) C 2 (Y - X) Y X {
                    sum += (Y - X) * B;
                } sum += (Y - X) * B sum (Y - X) * B (Y - X) Y X B {
            sum += X * A + Y * B;
        } sum += X * A + Y * B sum X * A + Y * B X * A X A Y * B Y B System.out.println(sum) System.out.println System.out System System.out sum private void solveD() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    } solveD {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc System.out.println(N) System.out.println System.out System System.out N private void solveE() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    } solveE {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc System.out.println(N) System.out.println System.out System System.out N private void solveF() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    } solveF {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc System.out.println(N) System.out.println System.out System System.out N public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solveC();
    }

    private void solveA() {
        Scanner sc = new Scanner(System.in);
        char[] N = sc.nextLine().toCharArray();
        int result = 700;
        for (char c : N) {
            if ("o".equals(String.valueOf(c))) {
                result += 100;
            }
        }
        System.out.println(result);
    }

    private void solveB() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int X = sc.nextInt();
        int cnt = 0;
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            list.add(sc.nextInt());
        }
        for (Integer integer : list) {
            X -= integer;
            cnt++;
        }

        Collections.sort(list);
        int min = list.get(0);
        while(min <= X) {
            X -= min;
            cnt++;
        }
        System.out.println(cnt);

    }

    // ABC095 at 2018/04/29
    private void solveC() {
        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 sum = 0;
        if (C * 2 < A + B) {
            sum += C * 2 * Math.min(X, Y);
            if (Math.max(X, Y) == X) {
                if (C * 2 * (X - Y) <  (X - Y) * A) {
                    sum += C * 2 * (X - Y);
                } else {
                    sum += (X - Y) * A;
                }
            } else {
                if (C * 2 * (Y - X) < (Y - X) * B) {
                    sum += C * 2 * (Y - X);
                } else {
                    sum += (Y - X) * B;
                }
            }
        } else {
            sum += X * A + Y * B;
        }
        System.out.println(sum);
    }

    private void solveD() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveE() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveF() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

} public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solveC();
    }

    private void solveA() {
        Scanner sc = new Scanner(System.in);
        char[] N = sc.nextLine().toCharArray();
        int result = 700;
        for (char c : N) {
            if ("o".equals(String.valueOf(c))) {
                result += 100;
            }
        }
        System.out.println(result);
    }

    private void solveB() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int X = sc.nextInt();
        int cnt = 0;
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            list.add(sc.nextInt());
        }
        for (Integer integer : list) {
            X -= integer;
            cnt++;
        }

        Collections.sort(list);
        int min = list.get(0);
        while(min <= X) {
            X -= min;
            cnt++;
        }
        System.out.println(cnt);

    }

    // ABC095 at 2018/04/29
    private void solveC() {
        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 sum = 0;
        if (C * 2 < A + B) {
            sum += C * 2 * Math.min(X, Y);
            if (Math.max(X, Y) == X) {
                if (C * 2 * (X - Y) <  (X - Y) * A) {
                    sum += C * 2 * (X - Y);
                } else {
                    sum += (X - Y) * A;
                }
            } else {
                if (C * 2 * (Y - X) < (Y - X) * B) {
                    sum += C * 2 * (Y - X);
                } else {
                    sum += (Y - X) * B;
                }
            }
        } else {
            sum += X * A + Y * B;
        }
        System.out.println(sum);
    }

    private void solveD() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveE() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveF() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

} Main

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

// ABC095 at 2018/04/24

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solveC();
    }

    private void solveA() {
        Scanner sc = new Scanner(System.in);
        char[] N = sc.nextLine().toCharArray();
        int result = 700;
        for (char c : N) {
            if ("o".equals(String.valueOf(c))) {
                result += 100;
            }
        }
        System.out.println(result);
    }

    private void solveB() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int X = sc.nextInt();
        int cnt = 0;
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            list.add(sc.nextInt());
        }
        for (Integer integer : list) {
            X -= integer;
            cnt++;
        }

        Collections.sort(list);
        int min = list.get(0);
        while(min <= X) {
            X -= min;
            cnt++;
        }
        System.out.println(cnt);

    }

    // ABC095 at 2018/04/29
    private void solveC() {
        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 sum = 0;
        if (C * 2 < A + B) {
            sum += C * 2 * Math.min(X, Y);
            if (Math.max(X, Y) == X) {
                if (C * 2 * (X - Y) <  (X - Y) * A) {
                    sum += C * 2 * (X - Y);
                } else {
                    sum += (X - Y) * A;
                }
            } else {
                if (C * 2 * (Y - X) < (Y - X) * B) {
                    sum += C * 2 * (Y - X);
                } else {
                    sum += (Y - X) * B;
                }
            }
        } else {
            sum += X * A + Y * B;
        }
        System.out.println(sum);
    }

    private void solveD() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveE() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveF() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

}