import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        int a_price = Integer.parseInt(sc.next());
        int b_price = Integer.parseInt(sc.next());
        int merge_price = Integer.parseInt(sc.next());
        int n_a = Integer.parseInt(sc.next());
        int n_b = Integer.parseInt(sc.next());
        //String s = sc.next();
        if(a_price+b_price > merge_price*2){
            if(n_a>n_b){
                if(a_price>merge_price*2){
                    System.out.println(merge_price*n_a*2);
                }else{
                    System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price);
                }
            }else{
                if(b_price>merge_price*2){
                    System.out.println(merge_price*n_b*2);
                }else{
                    System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price);
                }
            }
        } else {
            System.out.println(a_price*n_a + b_price*n_b);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        int a_price = Integer.parseInt(sc.next());
        int b_price = Integer.parseInt(sc.next());
        int merge_price = Integer.parseInt(sc.next());
        int n_a = Integer.parseInt(sc.next());
        int n_b = Integer.parseInt(sc.next());
        //String s = sc.next();
        if(a_price+b_price > merge_price*2){
            if(n_a>n_b){
                if(a_price>merge_price*2){
                    System.out.println(merge_price*n_a*2);
                }else{
                    System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price);
                }
            }else{
                if(b_price>merge_price*2){
                    System.out.println(merge_price*n_b*2);
                }else{
                    System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price);
                }
            }
        } else {
            System.out.println(a_price*n_a + b_price*n_b);
        }
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        int a_price = Integer.parseInt(sc.next());
        int b_price = Integer.parseInt(sc.next());
        int merge_price = Integer.parseInt(sc.next());
        int n_a = Integer.parseInt(sc.next());
        int n_b = Integer.parseInt(sc.next());
        //String s = sc.next();
        if(a_price+b_price > merge_price*2){
            if(n_a>n_b){
                if(a_price>merge_price*2){
                    System.out.println(merge_price*n_a*2);
                }else{
                    System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price);
                }
            }else{
                if(b_price>merge_price*2){
                    System.out.println(merge_price*n_b*2);
                }else{
                    System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price);
                }
            }
        } else {
            System.out.println(a_price*n_a + b_price*n_b);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        
        int a_price = Integer.parseInt(sc.next());
        int b_price = Integer.parseInt(sc.next());
        int merge_price = Integer.parseInt(sc.next());
        int n_a = Integer.parseInt(sc.next());
        int n_b = Integer.parseInt(sc.next());
        //String s = sc.next();
        if(a_price+b_price > merge_price*2){
            if(n_a>n_b){
                if(a_price>merge_price*2){
                    System.out.println(merge_price*n_a*2);
                }else{
                    System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price);
                }
            }else{
                if(b_price>merge_price*2){
                    System.out.println(merge_price*n_b*2);
                }else{
                    System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price);
                }
            }
        } else {
            System.out.println(a_price*n_a + b_price*n_b);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a_price = Integer.parseInt(sc.next()); a_price Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b_price = Integer.parseInt(sc.next()); b_price Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int merge_price = Integer.parseInt(sc.next()); merge_price Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int n_a = Integer.parseInt(sc.next()); n_a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int n_b = Integer.parseInt(sc.next()); n_b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if(a_price+b_price > merge_price*2){
            if(n_a>n_b){
                if(a_price>merge_price*2){
                    System.out.println(merge_price*n_a*2);
                }else{
                    System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price);
                }
            }else{
                if(b_price>merge_price*2){
                    System.out.println(merge_price*n_b*2);
                }else{
                    System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price);
                }
            }
        } else {
            System.out.println(a_price*n_a + b_price*n_b);
        } a_price+b_price > merge_price*2 a_price+b_price a_price b_price merge_price*2 merge_price 2 {
            if(n_a>n_b){
                if(a_price>merge_price*2){
                    System.out.println(merge_price*n_a*2);
                }else{
                    System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price);
                }
            }else{
                if(b_price>merge_price*2){
                    System.out.println(merge_price*n_b*2);
                }else{
                    System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price);
                }
            }
        } if(n_a>n_b){
                if(a_price>merge_price*2){
                    System.out.println(merge_price*n_a*2);
                }else{
                    System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price);
                }
            }else{
                if(b_price>merge_price*2){
                    System.out.println(merge_price*n_b*2);
                }else{
                    System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price);
                }
            } n_a>n_b n_a n_b {
                if(a_price>merge_price*2){
                    System.out.println(merge_price*n_a*2);
                }else{
                    System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price);
                }
            } if(a_price>merge_price*2){
                    System.out.println(merge_price*n_a*2);
                }else{
                    System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price);
                } a_price>merge_price*2 a_price merge_price*2 merge_price 2 {
                    System.out.println(merge_price*n_a*2);
                } System.out.println(merge_price*n_a*2) System.out.println System.out System System.out merge_price*n_a*2 merge_price*n_a*2 merge_price n_a 2 {
                    System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price);
                } System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price) System.out.println System.out System System.out merge_price*n_b*2+(n_a-n_b)*a_price merge_price*n_b*2 merge_price*n_b*2 merge_price n_b 2 (n_a-n_b)*a_price (n_a-n_b) n_a n_b a_price {
                if(b_price>merge_price*2){
                    System.out.println(merge_price*n_b*2);
                }else{
                    System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price);
                }
            } if(b_price>merge_price*2){
                    System.out.println(merge_price*n_b*2);
                }else{
                    System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price);
                } b_price>merge_price*2 b_price merge_price*2 merge_price 2 {
                    System.out.println(merge_price*n_b*2);
                } System.out.println(merge_price*n_b*2) System.out.println System.out System System.out merge_price*n_b*2 merge_price*n_b*2 merge_price n_b 2 {
                    System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price);
                } System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price) System.out.println System.out System System.out merge_price*n_a*2+(n_b-n_a)*b_price merge_price*n_a*2 merge_price*n_a*2 merge_price n_a 2 (n_b-n_a)*b_price (n_b-n_a) n_b n_a b_price {
            System.out.println(a_price*n_a + b_price*n_b);
        } System.out.println(a_price*n_a + b_price*n_b) System.out.println System.out System System.out a_price*n_a + b_price*n_b a_price*n_a a_price n_a b_price*n_b b_price n_b String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        int a_price = Integer.parseInt(sc.next());
        int b_price = Integer.parseInt(sc.next());
        int merge_price = Integer.parseInt(sc.next());
        int n_a = Integer.parseInt(sc.next());
        int n_b = Integer.parseInt(sc.next());
        //String s = sc.next();
        if(a_price+b_price > merge_price*2){
            if(n_a>n_b){
                if(a_price>merge_price*2){
                    System.out.println(merge_price*n_a*2);
                }else{
                    System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price);
                }
            }else{
                if(b_price>merge_price*2){
                    System.out.println(merge_price*n_b*2);
                }else{
                    System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price);
                }
            }
        } else {
            System.out.println(a_price*n_a + b_price*n_b);
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        int a_price = Integer.parseInt(sc.next());
        int b_price = Integer.parseInt(sc.next());
        int merge_price = Integer.parseInt(sc.next());
        int n_a = Integer.parseInt(sc.next());
        int n_b = Integer.parseInt(sc.next());
        //String s = sc.next();
        if(a_price+b_price > merge_price*2){
            if(n_a>n_b){
                if(a_price>merge_price*2){
                    System.out.println(merge_price*n_a*2);
                }else{
                    System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price);
                }
            }else{
                if(b_price>merge_price*2){
                    System.out.println(merge_price*n_b*2);
                }else{
                    System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price);
                }
            }
        } else {
            System.out.println(a_price*n_a + b_price*n_b);
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        int a_price = Integer.parseInt(sc.next());
        int b_price = Integer.parseInt(sc.next());
        int merge_price = Integer.parseInt(sc.next());
        int n_a = Integer.parseInt(sc.next());
        int n_b = Integer.parseInt(sc.next());
        //String s = sc.next();
        if(a_price+b_price > merge_price*2){
            if(n_a>n_b){
                if(a_price>merge_price*2){
                    System.out.println(merge_price*n_a*2);
                }else{
                    System.out.println(merge_price*n_b*2+(n_a-n_b)*a_price);
                }
            }else{
                if(b_price>merge_price*2){
                    System.out.println(merge_price*n_b*2);
                }else{
                    System.out.println(merge_price*n_a*2+(n_b-n_a)*b_price);
                }
            }
        } else {
            System.out.println(a_price*n_a + b_price*n_b);
        }
    }
}