import 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();
        int rx = x, ry = y;
        long ans = 0L;
        if(a+b > c*2){
            rx -= Math.min(x, y);
            ry -= Math.min(x, y);
            ans += c * Math.min(x, y) * 2;
        }
        if(0 < rx){
            if(a < c*2) ans += a * rx;
            else ans += c * 2 * rx;
        }
        if(0 < ry){
            if(b < c*2) ans += b * ry;
            else ans += c * 2 * ry;
        }

        System.out.println(ans);
        sc.close();

    }

} import java.util.*; util.* java 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();
        int rx = x, ry = y;
        long ans = 0L;
        if(a+b > c*2){
            rx -= Math.min(x, y);
            ry -= Math.min(x, y);
            ans += c * Math.min(x, y) * 2;
        }
        if(0 < rx){
            if(a < c*2) ans += a * rx;
            else ans += c * 2 * rx;
        }
        if(0 < ry){
            if(b < c*2) ans += b * ry;
            else ans += c * 2 * ry;
        }

        System.out.println(ans);
        sc.close();

    }

} 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();
        int rx = x, ry = y;
        long ans = 0L;
        if(a+b > c*2){
            rx -= Math.min(x, y);
            ry -= Math.min(x, y);
            ans += c * Math.min(x, y) * 2;
        }
        if(0 < rx){
            if(a < c*2) ans += a * rx;
            else ans += c * 2 * rx;
        }
        if(0 < ry){
            if(b < c*2) ans += b * ry;
            else ans += c * 2 * ry;
        }

        System.out.println(ans);
        sc.close();

    } 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();
        int rx = x, ry = y;
        long ans = 0L;
        if(a+b > c*2){
            rx -= Math.min(x, y);
            ry -= Math.min(x, y);
            ans += c * Math.min(x, y) * 2;
        }
        if(0 < rx){
            if(a < c*2) ans += a * rx;
            else ans += c * 2 * rx;
        }
        if(0 < ry){
            if(b < c*2) ans += b * ry;
            else ans += c * 2 * ry;
        }

        System.out.println(ans);
        sc.close();

    } 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 rx = x rx x ry = y; ry y long ans = 0L; ans 0L if(a+b > c*2){
            rx -= Math.min(x, y);
            ry -= Math.min(x, y);
            ans += c * Math.min(x, y) * 2;
        } a+b > c*2 a+b a b c*2 c 2 {
            rx -= Math.min(x, y);
            ry -= Math.min(x, y);
            ans += c * Math.min(x, y) * 2;
        } rx -= Math.min(x, y) rx Math.min(x, y) Math.min Math x y ry -= Math.min(x, y) ry Math.min(x, y) Math.min Math x y ans += c * Math.min(x, y) * 2 ans c * Math.min(x, y) * 2 c * Math.min(x, y) * 2 c Math.min(x, y) Math.min Math x y 2 if(0 < rx){
            if(a < c*2) ans += a * rx;
            else ans += c * 2 * rx;
        } 0 < rx 0 rx {
            if(a < c*2) ans += a * rx;
            else ans += c * 2 * rx;
        } if(a < c*2) ans += a * rx;
            else ans += c * 2 * rx; a < c*2 a c*2 c 2 ans += a * rx ans a * rx a rx ans += c * 2 * rx ans c * 2 * rx c * 2 * rx c 2 rx if(0 < ry){
            if(b < c*2) ans += b * ry;
            else ans += c * 2 * ry;
        } 0 < ry 0 ry {
            if(b < c*2) ans += b * ry;
            else ans += c * 2 * ry;
        } if(b < c*2) ans += b * ry;
            else ans += c * 2 * ry; b < c*2 b c*2 c 2 ans += b * ry ans b * ry b ry ans += c * 2 * ry ans c * 2 * ry c * 2 * ry c 2 ry System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc 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();
        int rx = x, ry = y;
        long ans = 0L;
        if(a+b > c*2){
            rx -= Math.min(x, y);
            ry -= Math.min(x, y);
            ans += c * Math.min(x, y) * 2;
        }
        if(0 < rx){
            if(a < c*2) ans += a * rx;
            else ans += c * 2 * rx;
        }
        if(0 < ry){
            if(b < c*2) ans += b * ry;
            else ans += c * 2 * ry;
        }

        System.out.println(ans);
        sc.close();

    }

} 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();
        int rx = x, ry = y;
        long ans = 0L;
        if(a+b > c*2){
            rx -= Math.min(x, y);
            ry -= Math.min(x, y);
            ans += c * Math.min(x, y) * 2;
        }
        if(0 < rx){
            if(a < c*2) ans += a * rx;
            else ans += c * 2 * rx;
        }
        if(0 < ry){
            if(b < c*2) ans += b * ry;
            else ans += c * 2 * ry;
        }

        System.out.println(ans);
        sc.close();

    }

} Main
import 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();
        int rx = x, ry = y;
        long ans = 0L;
        if(a+b > c*2){
            rx -= Math.min(x, y);
            ry -= Math.min(x, y);
            ans += c * Math.min(x, y) * 2;
        }
        if(0 < rx){
            if(a < c*2) ans += a * rx;
            else ans += c * 2 * rx;
        }
        if(0 < ry){
            if(b < c*2) ans += b * ry;
            else ans += c * 2 * ry;
        }

        System.out.println(ans);
        sc.close();

    }

}
