import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        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();
        
        boolean Aflag = X > Y;
        
        int Z = 0;
        
        if (Aflag){ 
            Z = X - Math.abs(X-Y);
        }else{
            Z = Y - Math.abs(X-Y);
        }
        
        long price = 0;
        
        if ((A+B) > C*2){
            price += Z*C*2;
            if (Aflag){
                if (A < 2*C){
                    price += (X-Z)*A;
                }else{
                    price += (X-Z)*2*C;
                }
            }else{
                if (B < 2*C){
                    price += (Y-Z)*B;
                }else{
                    price += (Y-Z)*2*C;
                }
            }
            
        }else{
            price += A*X;
            price += B*Y;
        }
        
        System.out.println(price);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        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();
        
        boolean Aflag = X > Y;
        
        int Z = 0;
        
        if (Aflag){ 
            Z = X - Math.abs(X-Y);
        }else{
            Z = Y - Math.abs(X-Y);
        }
        
        long price = 0;
        
        if ((A+B) > C*2){
            price += Z*C*2;
            if (Aflag){
                if (A < 2*C){
                    price += (X-Z)*A;
                }else{
                    price += (X-Z)*2*C;
                }
            }else{
                if (B < 2*C){
                    price += (Y-Z)*B;
                }else{
                    price += (Y-Z)*2*C;
                }
            }
            
        }else{
            price += A*X;
            price += B*Y;
        }
        
        System.out.println(price);
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        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();
        
        boolean Aflag = X > Y;
        
        int Z = 0;
        
        if (Aflag){ 
            Z = X - Math.abs(X-Y);
        }else{
            Z = Y - Math.abs(X-Y);
        }
        
        long price = 0;
        
        if ((A+B) > C*2){
            price += Z*C*2;
            if (Aflag){
                if (A < 2*C){
                    price += (X-Z)*A;
                }else{
                    price += (X-Z)*2*C;
                }
            }else{
                if (B < 2*C){
                    price += (Y-Z)*B;
                }else{
                    price += (Y-Z)*2*C;
                }
            }
            
        }else{
            price += A*X;
            price += B*Y;
        }
        
        System.out.println(price);
    } main {
        // Your code here!
        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();
        
        boolean Aflag = X > Y;
        
        int Z = 0;
        
        if (Aflag){ 
            Z = X - Math.abs(X-Y);
        }else{
            Z = Y - Math.abs(X-Y);
        }
        
        long price = 0;
        
        if ((A+B) > C*2){
            price += Z*C*2;
            if (Aflag){
                if (A < 2*C){
                    price += (X-Z)*A;
                }else{
                    price += (X-Z)*2*C;
                }
            }else{
                if (B < 2*C){
                    price += (Y-Z)*B;
                }else{
                    price += (Y-Z)*2*C;
                }
            }
            
        }else{
            price += A*X;
            price += B*Y;
        }
        
        System.out.println(price);
    } 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 boolean Aflag = X > Y; Aflag X > Y X Y int Z = 0; Z 0 if (Aflag){ 
            Z = X - Math.abs(X-Y);
        }else{
            Z = Y - Math.abs(X-Y);
        } Aflag { 
            Z = X - Math.abs(X-Y);
        } Z = X - Math.abs(X-Y) Z X - Math.abs(X-Y) X Math.abs(X-Y) Math.abs Math X-Y X Y {
            Z = Y - Math.abs(X-Y);
        } Z = Y - Math.abs(X-Y) Z Y - Math.abs(X-Y) Y Math.abs(X-Y) Math.abs Math X-Y X Y long price = 0; price 0 if ((A+B) > C*2){
            price += Z*C*2;
            if (Aflag){
                if (A < 2*C){
                    price += (X-Z)*A;
                }else{
                    price += (X-Z)*2*C;
                }
            }else{
                if (B < 2*C){
                    price += (Y-Z)*B;
                }else{
                    price += (Y-Z)*2*C;
                }
            }
            
        }else{
            price += A*X;
            price += B*Y;
        } (A+B) > C*2 (A+B) A B C*2 C 2 {
            price += Z*C*2;
            if (Aflag){
                if (A < 2*C){
                    price += (X-Z)*A;
                }else{
                    price += (X-Z)*2*C;
                }
            }else{
                if (B < 2*C){
                    price += (Y-Z)*B;
                }else{
                    price += (Y-Z)*2*C;
                }
            }
            
        } price += Z*C*2 price Z*C*2 Z*C*2 Z C 2 if (Aflag){
                if (A < 2*C){
                    price += (X-Z)*A;
                }else{
                    price += (X-Z)*2*C;
                }
            }else{
                if (B < 2*C){
                    price += (Y-Z)*B;
                }else{
                    price += (Y-Z)*2*C;
                }
            } Aflag {
                if (A < 2*C){
                    price += (X-Z)*A;
                }else{
                    price += (X-Z)*2*C;
                }
            } if (A < 2*C){
                    price += (X-Z)*A;
                }else{
                    price += (X-Z)*2*C;
                } A < 2*C A 2*C 2 C {
                    price += (X-Z)*A;
                } price += (X-Z)*A price (X-Z)*A (X-Z) X Z A {
                    price += (X-Z)*2*C;
                } price += (X-Z)*2*C price (X-Z)*2*C (X-Z)*2*C (X-Z) X Z 2 C {
                if (B < 2*C){
                    price += (Y-Z)*B;
                }else{
                    price += (Y-Z)*2*C;
                }
            } if (B < 2*C){
                    price += (Y-Z)*B;
                }else{
                    price += (Y-Z)*2*C;
                } B < 2*C B 2*C 2 C {
                    price += (Y-Z)*B;
                } price += (Y-Z)*B price (Y-Z)*B (Y-Z) Y Z B {
                    price += (Y-Z)*2*C;
                } price += (Y-Z)*2*C price (Y-Z)*2*C (Y-Z)*2*C (Y-Z) Y Z 2 C {
            price += A*X;
            price += B*Y;
        } price += A*X price A*X A X price += B*Y price B*Y B Y System.out.println(price) System.out.println System.out System System.out price String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        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();
        
        boolean Aflag = X > Y;
        
        int Z = 0;
        
        if (Aflag){ 
            Z = X - Math.abs(X-Y);
        }else{
            Z = Y - Math.abs(X-Y);
        }
        
        long price = 0;
        
        if ((A+B) > C*2){
            price += Z*C*2;
            if (Aflag){
                if (A < 2*C){
                    price += (X-Z)*A;
                }else{
                    price += (X-Z)*2*C;
                }
            }else{
                if (B < 2*C){
                    price += (Y-Z)*B;
                }else{
                    price += (Y-Z)*2*C;
                }
            }
            
        }else{
            price += A*X;
            price += B*Y;
        }
        
        System.out.println(price);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        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();
        
        boolean Aflag = X > Y;
        
        int Z = 0;
        
        if (Aflag){ 
            Z = X - Math.abs(X-Y);
        }else{
            Z = Y - Math.abs(X-Y);
        }
        
        long price = 0;
        
        if ((A+B) > C*2){
            price += Z*C*2;
            if (Aflag){
                if (A < 2*C){
                    price += (X-Z)*A;
                }else{
                    price += (X-Z)*2*C;
                }
            }else{
                if (B < 2*C){
                    price += (Y-Z)*B;
                }else{
                    price += (Y-Z)*2*C;
                }
            }
            
        }else{
            price += A*X;
            price += B*Y;
        }
        
        System.out.println(price);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        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();
        
        boolean Aflag = X > Y;
        
        int Z = 0;
        
        if (Aflag){ 
            Z = X - Math.abs(X-Y);
        }else{
            Z = Y - Math.abs(X-Y);
        }
        
        long price = 0;
        
        if ((A+B) > C*2){
            price += Z*C*2;
            if (Aflag){
                if (A < 2*C){
                    price += (X-Z)*A;
                }else{
                    price += (X-Z)*2*C;
                }
            }else{
                if (B < 2*C){
                    price += (Y-Z)*B;
                }else{
                    price += (Y-Z)*2*C;
                }
            }
            
        }else{
            price += A*X;
            price += B*Y;
        }
        
        System.out.println(price);
    }
}
