import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        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();

        long total = 0;

        int cc = c + c;
        int ab = a + b;
        int aa = a + a;
        int bb = b + b;
        while (x > 0 || y > 0) {

            if (x > 0 && y > 0) {
                if (cc < ab) {
                    total += cc;
                } else {
                    total += ab;
                }
                x -= 1;
                y -= 1;
            } else if (x > 0) {
                if (cc < a) {
                    total += cc;
                } else {
                    total += a;
                }
                x -= 1;
            } else {
                if (cc < b) {
                    total += cc;
                } else {
                    total += b;
                }
                y -= 1;
            }

        }

        System.out.println(total);

    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

        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();

        long total = 0;

        int cc = c + c;
        int ab = a + b;
        int aa = a + a;
        int bb = b + b;
        while (x > 0 || y > 0) {

            if (x > 0 && y > 0) {
                if (cc < ab) {
                    total += cc;
                } else {
                    total += ab;
                }
                x -= 1;
                y -= 1;
            } else if (x > 0) {
                if (cc < a) {
                    total += cc;
                } else {
                    total += a;
                }
                x -= 1;
            } else {
                if (cc < b) {
                    total += cc;
                } else {
                    total += b;
                }
                y -= 1;
            }

        }

        System.out.println(total);

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

        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();

        long total = 0;

        int cc = c + c;
        int ab = a + b;
        int aa = a + a;
        int bb = b + b;
        while (x > 0 || y > 0) {

            if (x > 0 && y > 0) {
                if (cc < ab) {
                    total += cc;
                } else {
                    total += ab;
                }
                x -= 1;
                y -= 1;
            } else if (x > 0) {
                if (cc < a) {
                    total += cc;
                } else {
                    total += a;
                }
                x -= 1;
            } else {
                if (cc < b) {
                    total += cc;
                } else {
                    total += b;
                }
                y -= 1;
            }

        }

        System.out.println(total);

    } main {

        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();

        long total = 0;

        int cc = c + c;
        int ab = a + b;
        int aa = a + a;
        int bb = b + b;
        while (x > 0 || y > 0) {

            if (x > 0 && y > 0) {
                if (cc < ab) {
                    total += cc;
                } else {
                    total += ab;
                }
                x -= 1;
                y -= 1;
            } else if (x > 0) {
                if (cc < a) {
                    total += cc;
                } else {
                    total += a;
                }
                x -= 1;
            } else {
                if (cc < b) {
                    total += cc;
                } else {
                    total += b;
                }
                y -= 1;
            }

        }

        System.out.println(total);

    } 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 long total = 0; total 0 int cc = c + c; cc c + c c c int ab = a + b; ab a + b a b int aa = a + a; aa a + a a a int bb = b + b; bb b + b b b while (x > 0 || y > 0) {

            if (x > 0 && y > 0) {
                if (cc < ab) {
                    total += cc;
                } else {
                    total += ab;
                }
                x -= 1;
                y -= 1;
            } else if (x > 0) {
                if (cc < a) {
                    total += cc;
                } else {
                    total += a;
                }
                x -= 1;
            } else {
                if (cc < b) {
                    total += cc;
                } else {
                    total += b;
                }
                y -= 1;
            }

        } x > 0 || y > 0 x > 0 x 0 y > 0 y 0 {

            if (x > 0 && y > 0) {
                if (cc < ab) {
                    total += cc;
                } else {
                    total += ab;
                }
                x -= 1;
                y -= 1;
            } else if (x > 0) {
                if (cc < a) {
                    total += cc;
                } else {
                    total += a;
                }
                x -= 1;
            } else {
                if (cc < b) {
                    total += cc;
                } else {
                    total += b;
                }
                y -= 1;
            }

        } if (x > 0 && y > 0) {
                if (cc < ab) {
                    total += cc;
                } else {
                    total += ab;
                }
                x -= 1;
                y -= 1;
            } else if (x > 0) {
                if (cc < a) {
                    total += cc;
                } else {
                    total += a;
                }
                x -= 1;
            } else {
                if (cc < b) {
                    total += cc;
                } else {
                    total += b;
                }
                y -= 1;
            } x > 0 && y > 0 x > 0 x 0 y > 0 y 0 {
                if (cc < ab) {
                    total += cc;
                } else {
                    total += ab;
                }
                x -= 1;
                y -= 1;
            } if (cc < ab) {
                    total += cc;
                } else {
                    total += ab;
                } cc < ab cc ab {
                    total += cc;
                } total += cc total cc {
                    total += ab;
                } total += ab total ab x -= 1 x 1 y -= 1 y 1 if (x > 0) {
                if (cc < a) {
                    total += cc;
                } else {
                    total += a;
                }
                x -= 1;
            } else {
                if (cc < b) {
                    total += cc;
                } else {
                    total += b;
                }
                y -= 1;
            } x > 0 x 0 {
                if (cc < a) {
                    total += cc;
                } else {
                    total += a;
                }
                x -= 1;
            } if (cc < a) {
                    total += cc;
                } else {
                    total += a;
                } cc < a cc a {
                    total += cc;
                } total += cc total cc {
                    total += a;
                } total += a total a x -= 1 x 1 {
                if (cc < b) {
                    total += cc;
                } else {
                    total += b;
                }
                y -= 1;
            } if (cc < b) {
                    total += cc;
                } else {
                    total += b;
                } cc < b cc b {
                    total += cc;
                } total += cc total cc {
                    total += b;
                } total += b total b y -= 1 y 1 System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {

    public static void main(String[] args) {

        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();

        long total = 0;

        int cc = c + c;
        int ab = a + b;
        int aa = a + a;
        int bb = b + b;
        while (x > 0 || y > 0) {

            if (x > 0 && y > 0) {
                if (cc < ab) {
                    total += cc;
                } else {
                    total += ab;
                }
                x -= 1;
                y -= 1;
            } else if (x > 0) {
                if (cc < a) {
                    total += cc;
                } else {
                    total += a;
                }
                x -= 1;
            } else {
                if (cc < b) {
                    total += cc;
                } else {
                    total += b;
                }
                y -= 1;
            }

        }

        System.out.println(total);

    }
} public class Main {

    public static void main(String[] args) {

        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();

        long total = 0;

        int cc = c + c;
        int ab = a + b;
        int aa = a + a;
        int bb = b + b;
        while (x > 0 || y > 0) {

            if (x > 0 && y > 0) {
                if (cc < ab) {
                    total += cc;
                } else {
                    total += ab;
                }
                x -= 1;
                y -= 1;
            } else if (x > 0) {
                if (cc < a) {
                    total += cc;
                } else {
                    total += a;
                }
                x -= 1;
            } else {
                if (cc < b) {
                    total += cc;
                } else {
                    total += b;
                }
                y -= 1;
            }

        }

        System.out.println(total);

    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        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();

        long total = 0;

        int cc = c + c;
        int ab = a + b;
        int aa = a + a;
        int bb = b + b;
        while (x > 0 || y > 0) {

            if (x > 0 && y > 0) {
                if (cc < ab) {
                    total += cc;
                } else {
                    total += ab;
                }
                x -= 1;
                y -= 1;
            } else if (x > 0) {
                if (cc < a) {
                    total += cc;
                } else {
                    total += a;
                }
                x -= 1;
            } else {
                if (cc < b) {
                    total += cc;
                } else {
                    total += b;
                }
                y -= 1;
            }

        }

        System.out.println(total);

    }
}
