import java.util.Scanner;

public class Main {

    static int A;
    static int B;
    static int C;
    static int X;
    static int Y;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        A = sc.nextInt();
        B = sc.nextInt();
        C = sc.nextInt();
        X = sc.nextInt();
        Y = sc.nextInt();

        solve();
    }

    public static void solve() {
        long sum = 0;

        if (A + B > C * 2) {
            if (X > Y) {
                sum = C * Y * 2;

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

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

        System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    static int A;
    static int B;
    static int C;
    static int X;
    static int Y;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        A = sc.nextInt();
        B = sc.nextInt();
        C = sc.nextInt();
        X = sc.nextInt();
        Y = sc.nextInt();

        solve();
    }

    public static void solve() {
        long sum = 0;

        if (A + B > C * 2) {
            if (X > Y) {
                sum = C * Y * 2;

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

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

        System.out.println(sum);
    }
} Main static int A; A static int B; B static int C; C static int X; X static int Y; Y public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        A = sc.nextInt();
        B = sc.nextInt();
        C = sc.nextInt();
        X = sc.nextInt();
        Y = sc.nextInt();

        solve();
    } main {
        Scanner sc = new Scanner(System.in);
        A = sc.nextInt();
        B = sc.nextInt();
        C = sc.nextInt();
        X = sc.nextInt();
        Y = sc.nextInt();

        solve();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) A = sc.nextInt() A sc.nextInt() sc.nextInt sc B = sc.nextInt() B sc.nextInt() sc.nextInt sc C = sc.nextInt() C sc.nextInt() sc.nextInt sc X = sc.nextInt() X sc.nextInt() sc.nextInt sc Y = sc.nextInt() Y sc.nextInt() sc.nextInt sc solve() solve String[] args args public static void solve() {
        long sum = 0;

        if (A + B > C * 2) {
            if (X > Y) {
                sum = C * Y * 2;

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

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

        System.out.println(sum);
    } solve {
        long sum = 0;

        if (A + B > C * 2) {
            if (X > Y) {
                sum = C * Y * 2;

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

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

        System.out.println(sum);
    } long sum = 0; sum 0 if (A + B > C * 2) {
            if (X > Y) {
                sum = C * Y * 2;

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

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

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

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

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

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

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

                if (B < C * 2) {
                    sum += (Y - X) * B;
                } else {
                    sum += (Y - X) * C * 2;
                }
            } sum = C * X * 2 sum C * X * 2 C * X * 2 C X 2 if (B < C * 2) {
                    sum += (Y - X) * B;
                } else {
                    sum += (Y - X) * C * 2;
                } B < C * 2 B C * 2 C 2 {
                    sum += (Y - X) * B;
                } sum += (Y - X) * B sum (Y - X) * B (Y - X) Y X B {
                    sum += (Y - X) * C * 2;
                } sum += (Y - X) * C * 2 sum (Y - X) * C * 2 (Y - X) * C * 2 (Y - X) Y X C 2 {
            sum = A * X + B * Y;
        } sum = A * X + B * Y sum A * X + B * Y A * X A X B * Y B Y System.out.println(sum) System.out.println System.out System System.out sum public class Main {

    static int A;
    static int B;
    static int C;
    static int X;
    static int Y;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        A = sc.nextInt();
        B = sc.nextInt();
        C = sc.nextInt();
        X = sc.nextInt();
        Y = sc.nextInt();

        solve();
    }

    public static void solve() {
        long sum = 0;

        if (A + B > C * 2) {
            if (X > Y) {
                sum = C * Y * 2;

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

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

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

    static int A;
    static int B;
    static int C;
    static int X;
    static int Y;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        A = sc.nextInt();
        B = sc.nextInt();
        C = sc.nextInt();
        X = sc.nextInt();
        Y = sc.nextInt();

        solve();
    }

    public static void solve() {
        long sum = 0;

        if (A + B > C * 2) {
            if (X > Y) {
                sum = C * Y * 2;

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

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

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

public class Main {

    static int A;
    static int B;
    static int C;
    static int X;
    static int Y;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        A = sc.nextInt();
        B = sc.nextInt();
        C = sc.nextInt();
        X = sc.nextInt();
        Y = sc.nextInt();

        solve();
    }

    public static void solve() {
        long sum = 0;

        if (A + B > C * 2) {
            if (X > Y) {
                sum = C * Y * 2;

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

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

        System.out.println(sum);
    }
}
