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 CC = sc.nextInt();
        int C = 2*CC;
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int ans = 0;
        if(C <= A && C <= B){
            ans = 2*Math.max(X, Y)*CC;
        }else if(C <= A && C > B){
            ans += 2*X*CC;
            ans += Math.max(0, Y-X)*B;
        }else if(C > A && C <= B){
            ans += 2*Y*CC;
            ans += Math.max(0, X-Y)*A;
        }else if(C < A+B){
            if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            }
        }else{
            ans += A*X+B*Y;
        }
        System.out.println(ans);
    }
} 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 CC = sc.nextInt();
        int C = 2*CC;
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int ans = 0;
        if(C <= A && C <= B){
            ans = 2*Math.max(X, Y)*CC;
        }else if(C <= A && C > B){
            ans += 2*X*CC;
            ans += Math.max(0, Y-X)*B;
        }else if(C > A && C <= B){
            ans += 2*Y*CC;
            ans += Math.max(0, X-Y)*A;
        }else if(C < A+B){
            if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            }
        }else{
            ans += A*X+B*Y;
        }
        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 CC = sc.nextInt();
        int C = 2*CC;
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int ans = 0;
        if(C <= A && C <= B){
            ans = 2*Math.max(X, Y)*CC;
        }else if(C <= A && C > B){
            ans += 2*X*CC;
            ans += Math.max(0, Y-X)*B;
        }else if(C > A && C <= B){
            ans += 2*Y*CC;
            ans += Math.max(0, X-Y)*A;
        }else if(C < A+B){
            if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            }
        }else{
            ans += A*X+B*Y;
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int CC = sc.nextInt();
        int C = 2*CC;
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int ans = 0;
        if(C <= A && C <= B){
            ans = 2*Math.max(X, Y)*CC;
        }else if(C <= A && C > B){
            ans += 2*X*CC;
            ans += Math.max(0, Y-X)*B;
        }else if(C > A && C <= B){
            ans += 2*Y*CC;
            ans += Math.max(0, X-Y)*A;
        }else if(C < A+B){
            if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            }
        }else{
            ans += A*X+B*Y;
        }
        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 CC = sc.nextInt(); CC sc.nextInt() sc.nextInt sc int C = 2*CC; C 2*CC 2 CC int X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int Y = sc.nextInt(); Y sc.nextInt() sc.nextInt sc int ans = 0; ans 0 if(C <= A && C <= B){
            ans = 2*Math.max(X, Y)*CC;
        }else if(C <= A && C > B){
            ans += 2*X*CC;
            ans += Math.max(0, Y-X)*B;
        }else if(C > A && C <= B){
            ans += 2*Y*CC;
            ans += Math.max(0, X-Y)*A;
        }else if(C < A+B){
            if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            }
        }else{
            ans += A*X+B*Y;
        } C <= A && C <= B C <= A C A C <= B C B {
            ans = 2*Math.max(X, Y)*CC;
        } ans = 2*Math.max(X, Y)*CC ans 2*Math.max(X, Y)*CC 2*Math.max(X, Y)*CC 2 Math.max(X, Y) Math.max Math X Y CC if(C <= A && C > B){
            ans += 2*X*CC;
            ans += Math.max(0, Y-X)*B;
        }else if(C > A && C <= B){
            ans += 2*Y*CC;
            ans += Math.max(0, X-Y)*A;
        }else if(C < A+B){
            if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            }
        }else{
            ans += A*X+B*Y;
        } C <= A && C > B C <= A C A C > B C B {
            ans += 2*X*CC;
            ans += Math.max(0, Y-X)*B;
        } ans += 2*X*CC ans 2*X*CC 2*X*CC 2 X CC ans += Math.max(0, Y-X)*B ans Math.max(0, Y-X)*B Math.max(0, Y-X) Math.max Math 0 Y-X Y X B if(C > A && C <= B){
            ans += 2*Y*CC;
            ans += Math.max(0, X-Y)*A;
        }else if(C < A+B){
            if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            }
        }else{
            ans += A*X+B*Y;
        } C > A && C <= B C > A C A C <= B C B {
            ans += 2*Y*CC;
            ans += Math.max(0, X-Y)*A;
        } ans += 2*Y*CC ans 2*Y*CC 2*Y*CC 2 Y CC ans += Math.max(0, X-Y)*A ans Math.max(0, X-Y)*A Math.max(0, X-Y) Math.max Math 0 X-Y X Y A if(C < A+B){
            if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            }
        }else{
            ans += A*X+B*Y;
        } C < A+B C A+B A B {
            if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            }
        } if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            } X >= Y X Y {
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            } ans += 2*Y*CC ans 2*Y*CC 2*Y*CC 2 Y CC ans += Math.max(0, X-Y)*A ans Math.max(0, X-Y)*A Math.max(0, X-Y) Math.max Math 0 X-Y X Y A {
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            } ans += 2*X*CC ans 2*X*CC 2*X*CC 2 X CC ans += Math.max(0, Y-X)*B ans Math.max(0, Y-X)*B Math.max(0, Y-X) Math.max Math 0 Y-X Y X B {
            ans += A*X+B*Y;
        } ans += A*X+B*Y ans A*X+B*Y A*X A X B*Y B Y 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 CC = sc.nextInt();
        int C = 2*CC;
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int ans = 0;
        if(C <= A && C <= B){
            ans = 2*Math.max(X, Y)*CC;
        }else if(C <= A && C > B){
            ans += 2*X*CC;
            ans += Math.max(0, Y-X)*B;
        }else if(C > A && C <= B){
            ans += 2*Y*CC;
            ans += Math.max(0, X-Y)*A;
        }else if(C < A+B){
            if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            }
        }else{
            ans += A*X+B*Y;
        }
        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 CC = sc.nextInt();
        int C = 2*CC;
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int ans = 0;
        if(C <= A && C <= B){
            ans = 2*Math.max(X, Y)*CC;
        }else if(C <= A && C > B){
            ans += 2*X*CC;
            ans += Math.max(0, Y-X)*B;
        }else if(C > A && C <= B){
            ans += 2*Y*CC;
            ans += Math.max(0, X-Y)*A;
        }else if(C < A+B){
            if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            }
        }else{
            ans += A*X+B*Y;
        }
        System.out.println(ans);
    }
} 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 CC = sc.nextInt();
        int C = 2*CC;
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int ans = 0;
        if(C <= A && C <= B){
            ans = 2*Math.max(X, Y)*CC;
        }else if(C <= A && C > B){
            ans += 2*X*CC;
            ans += Math.max(0, Y-X)*B;
        }else if(C > A && C <= B){
            ans += 2*Y*CC;
            ans += Math.max(0, X-Y)*A;
        }else if(C < A+B){
            if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            }
        }else{
            ans += A*X+B*Y;
        }
        System.out.println(ans);
    }
}