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 ans = 0;

        int min = Math.min(x, y);
        if ((a*min + b*min) > c*min*2) {
            ans += c*min*2;
            x -= min;
            y -= min;
        } else {
            ans += a*min + b * min;
            x -= min;
            y -= min;
        }

        int num = x > y ? a : b;
        int max = Math.max(x, y);
        if (num*max > c*max*2) {
            ans += c*max*2;
        } else {
            ans += num * max;
        }

        System.out.println(ans);
    }
} 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 ans = 0;

        int min = Math.min(x, y);
        if ((a*min + b*min) > c*min*2) {
            ans += c*min*2;
            x -= min;
            y -= min;
        } else {
            ans += a*min + b * min;
            x -= min;
            y -= min;
        }

        int num = x > y ? a : b;
        int max = Math.max(x, y);
        if (num*max > c*max*2) {
            ans += c*max*2;
        } else {
            ans += num * max;
        }

        System.out.println(ans);
    }
} 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 ans = 0;

        int min = Math.min(x, y);
        if ((a*min + b*min) > c*min*2) {
            ans += c*min*2;
            x -= min;
            y -= min;
        } else {
            ans += a*min + b * min;
            x -= min;
            y -= min;
        }

        int num = x > y ? a : b;
        int max = Math.max(x, y);
        if (num*max > c*max*2) {
            ans += c*max*2;
        } else {
            ans += num * max;
        }

        System.out.println(ans);
    } 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 ans = 0;

        int min = Math.min(x, y);
        if ((a*min + b*min) > c*min*2) {
            ans += c*min*2;
            x -= min;
            y -= min;
        } else {
            ans += a*min + b * min;
            x -= min;
            y -= min;
        }

        int num = x > y ? a : b;
        int max = Math.max(x, y);
        if (num*max > c*max*2) {
            ans += c*max*2;
        } else {
            ans += num * max;
        }

        System.out.println(ans);
    } 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 ans = 0; ans 0 int min = Math.min(x, y); min Math.min(x, y) Math.min Math x y if ((a*min + b*min) > c*min*2) {
            ans += c*min*2;
            x -= min;
            y -= min;
        } else {
            ans += a*min + b * min;
            x -= min;
            y -= min;
        } (a*min + b*min) > c*min*2 (a*min + b*min) a*min a min b*min b min c*min*2 c*min*2 c min 2 {
            ans += c*min*2;
            x -= min;
            y -= min;
        } ans += c*min*2 ans c*min*2 c*min*2 c min 2 x -= min x min y -= min y min {
            ans += a*min + b * min;
            x -= min;
            y -= min;
        } ans += a*min + b * min ans a*min + b * min a*min a min b * min b min x -= min x min y -= min y min int num = x > y ? a : b; num x > y ? a : b x > y x y a b int max = Math.max(x, y); max Math.max(x, y) Math.max Math x y if (num*max > c*max*2) {
            ans += c*max*2;
        } else {
            ans += num * max;
        } num*max > c*max*2 num*max num max c*max*2 c*max*2 c max 2 {
            ans += c*max*2;
        } ans += c*max*2 ans c*max*2 c*max*2 c max 2 {
            ans += num * max;
        } ans += num * max ans num * max num max System.out.println(ans) System.out.println System.out System System.out ans 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 ans = 0;

        int min = Math.min(x, y);
        if ((a*min + b*min) > c*min*2) {
            ans += c*min*2;
            x -= min;
            y -= min;
        } else {
            ans += a*min + b * min;
            x -= min;
            y -= min;
        }

        int num = x > y ? a : b;
        int max = Math.max(x, y);
        if (num*max > c*max*2) {
            ans += c*max*2;
        } else {
            ans += num * max;
        }

        System.out.println(ans);
    }
} 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 ans = 0;

        int min = Math.min(x, y);
        if ((a*min + b*min) > c*min*2) {
            ans += c*min*2;
            x -= min;
            y -= min;
        } else {
            ans += a*min + b * min;
            x -= min;
            y -= min;
        }

        int num = x > y ? a : b;
        int max = Math.max(x, y);
        if (num*max > c*max*2) {
            ans += c*max*2;
        } else {
            ans += num * max;
        }

        System.out.println(ans);
    }
} 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 ans = 0;

        int min = Math.min(x, y);
        if ((a*min + b*min) > c*min*2) {
            ans += c*min*2;
            x -= min;
            y -= min;
        } else {
            ans += a*min + b * min;
            x -= min;
            y -= min;
        }

        int num = x > y ? a : b;
        int max = Math.max(x, y);
        if (num*max > c*max*2) {
            ans += c*max*2;
        } else {
            ans += num * max;
        }

        System.out.println(ans);
    }
}
