import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int ans = 2;
        if(a+b <= c*2) {
            ans = a*x + b*y;
        }else {
            if(a <= c*2 && b <= c*2) { 
                if(x >= y) ans = c*2*y + a*(x-y);
                else ans = c*2*x + b*(y-x);
            }else if(a >= c*2 && b <= c*2) {
                if(x >= y) ans = c*2*x;
                else ans = c*2*x + b*(y-x);
            }else if(a <= c*2 && b >= c*2) {
                if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y);
            }else {
                ans = c*2*max(x,y);
            }
        }
        System.out.println(ans);
    }
    
    static int max(int x, int y) {
        if(x >= y) return x;
        else return y;
    }
    
    static int min(int x, int y) {
        if(x >= y) return y;
        else return x;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int ans = 2;
        if(a+b <= c*2) {
            ans = a*x + b*y;
        }else {
            if(a <= c*2 && b <= c*2) { 
                if(x >= y) ans = c*2*y + a*(x-y);
                else ans = c*2*x + b*(y-x);
            }else if(a >= c*2 && b <= c*2) {
                if(x >= y) ans = c*2*x;
                else ans = c*2*x + b*(y-x);
            }else if(a <= c*2 && b >= c*2) {
                if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y);
            }else {
                ans = c*2*max(x,y);
            }
        }
        System.out.println(ans);
    }
    
    static int max(int x, int y) {
        if(x >= y) return x;
        else return y;
    }
    
    static int min(int x, int y) {
        if(x >= y) return y;
        else return x;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int ans = 2;
        if(a+b <= c*2) {
            ans = a*x + b*y;
        }else {
            if(a <= c*2 && b <= c*2) { 
                if(x >= y) ans = c*2*y + a*(x-y);
                else ans = c*2*x + b*(y-x);
            }else if(a >= c*2 && b <= c*2) {
                if(x >= y) ans = c*2*x;
                else ans = c*2*x + b*(y-x);
            }else if(a <= c*2 && b >= c*2) {
                if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y);
            }else {
                ans = c*2*max(x,y);
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int ans = 2;
        if(a+b <= c*2) {
            ans = a*x + b*y;
        }else {
            if(a <= c*2 && b <= c*2) { 
                if(x >= y) ans = c*2*y + a*(x-y);
                else ans = c*2*x + b*(y-x);
            }else if(a >= c*2 && b <= c*2) {
                if(x >= y) ans = c*2*x;
                else ans = c*2*x + b*(y-x);
            }else if(a <= c*2 && b >= c*2) {
                if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y);
            }else {
                ans = c*2*max(x,y);
            }
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c = Integer.parseInt(sc.next()); c Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int x = Integer.parseInt(sc.next()); x Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int y = Integer.parseInt(sc.next()); y Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int ans = 2; ans 2 if(a+b <= c*2) {
            ans = a*x + b*y;
        }else {
            if(a <= c*2 && b <= c*2) { 
                if(x >= y) ans = c*2*y + a*(x-y);
                else ans = c*2*x + b*(y-x);
            }else if(a >= c*2 && b <= c*2) {
                if(x >= y) ans = c*2*x;
                else ans = c*2*x + b*(y-x);
            }else if(a <= c*2 && b >= c*2) {
                if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y);
            }else {
                ans = c*2*max(x,y);
            }
        } a+b <= c*2 a+b a b c*2 c 2 {
            ans = a*x + b*y;
        } ans = a*x + b*y ans a*x + b*y a*x a x b*y b y {
            if(a <= c*2 && b <= c*2) { 
                if(x >= y) ans = c*2*y + a*(x-y);
                else ans = c*2*x + b*(y-x);
            }else if(a >= c*2 && b <= c*2) {
                if(x >= y) ans = c*2*x;
                else ans = c*2*x + b*(y-x);
            }else if(a <= c*2 && b >= c*2) {
                if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y);
            }else {
                ans = c*2*max(x,y);
            }
        } if(a <= c*2 && b <= c*2) { 
                if(x >= y) ans = c*2*y + a*(x-y);
                else ans = c*2*x + b*(y-x);
            }else if(a >= c*2 && b <= c*2) {
                if(x >= y) ans = c*2*x;
                else ans = c*2*x + b*(y-x);
            }else if(a <= c*2 && b >= c*2) {
                if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y);
            }else {
                ans = c*2*max(x,y);
            } a <= c*2 && b <= c*2 a <= c*2 a c*2 c 2 b <= c*2 b c*2 c 2 { 
                if(x >= y) ans = c*2*y + a*(x-y);
                else ans = c*2*x + b*(y-x);
            } if(x >= y) ans = c*2*y + a*(x-y);
                else ans = c*2*x + b*(y-x); x >= y x y ans = c*2*y + a*(x-y) ans c*2*y + a*(x-y) c*2*y c*2*y c 2 y a*(x-y) a (x-y) x y ans = c*2*x + b*(y-x) ans c*2*x + b*(y-x) c*2*x c*2*x c 2 x b*(y-x) b (y-x) y x if(a >= c*2 && b <= c*2) {
                if(x >= y) ans = c*2*x;
                else ans = c*2*x + b*(y-x);
            }else if(a <= c*2 && b >= c*2) {
                if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y);
            }else {
                ans = c*2*max(x,y);
            } a >= c*2 && b <= c*2 a >= c*2 a c*2 c 2 b <= c*2 b c*2 c 2 {
                if(x >= y) ans = c*2*x;
                else ans = c*2*x + b*(y-x);
            } if(x >= y) ans = c*2*x;
                else ans = c*2*x + b*(y-x); x >= y x y ans = c*2*x ans c*2*x c*2*x c 2 x ans = c*2*x + b*(y-x) ans c*2*x + b*(y-x) c*2*x c*2*x c 2 x b*(y-x) b (y-x) y x if(a <= c*2 && b >= c*2) {
                if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y);
            }else {
                ans = c*2*max(x,y);
            } a <= c*2 && b >= c*2 a <= c*2 a c*2 c 2 b >= c*2 b c*2 c 2 {
                if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y);
            } if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y); y >= x y x ans = c*2*y ans c*2*y c*2*y c 2 y ans = c*2*y + a*(x-y) ans c*2*y + a*(x-y) c*2*y c*2*y c 2 y a*(x-y) a (x-y) x y {
                ans = c*2*max(x,y);
            } ans = c*2*max(x,y) ans c*2*max(x,y) c*2*max(x,y) c 2 max(x,y) max x y System.out.println(ans) System.out.println System.out System System.out ans String[] args args static int max(int x, int y) {
        if(x >= y) return x;
        else return y;
    } max {
        if(x >= y) return x;
        else return y;
    } if(x >= y) return x;
        else return y; x >= y x y return x; x return y; y int x x int y y static int min(int x, int y) {
        if(x >= y) return y;
        else return x;
    } min {
        if(x >= y) return y;
        else return x;
    } if(x >= y) return y;
        else return x; x >= y x y return y; y return x; x int x x int y y public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int ans = 2;
        if(a+b <= c*2) {
            ans = a*x + b*y;
        }else {
            if(a <= c*2 && b <= c*2) { 
                if(x >= y) ans = c*2*y + a*(x-y);
                else ans = c*2*x + b*(y-x);
            }else if(a >= c*2 && b <= c*2) {
                if(x >= y) ans = c*2*x;
                else ans = c*2*x + b*(y-x);
            }else if(a <= c*2 && b >= c*2) {
                if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y);
            }else {
                ans = c*2*max(x,y);
            }
        }
        System.out.println(ans);
    }
    
    static int max(int x, int y) {
        if(x >= y) return x;
        else return y;
    }
    
    static int min(int x, int y) {
        if(x >= y) return y;
        else return x;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int ans = 2;
        if(a+b <= c*2) {
            ans = a*x + b*y;
        }else {
            if(a <= c*2 && b <= c*2) { 
                if(x >= y) ans = c*2*y + a*(x-y);
                else ans = c*2*x + b*(y-x);
            }else if(a >= c*2 && b <= c*2) {
                if(x >= y) ans = c*2*x;
                else ans = c*2*x + b*(y-x);
            }else if(a <= c*2 && b >= c*2) {
                if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y);
            }else {
                ans = c*2*max(x,y);
            }
        }
        System.out.println(ans);
    }
    
    static int max(int x, int y) {
        if(x >= y) return x;
        else return y;
    }
    
    static int min(int x, int y) {
        if(x >= y) return y;
        else return x;
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int ans = 2;
        if(a+b <= c*2) {
            ans = a*x + b*y;
        }else {
            if(a <= c*2 && b <= c*2) { 
                if(x >= y) ans = c*2*y + a*(x-y);
                else ans = c*2*x + b*(y-x);
            }else if(a >= c*2 && b <= c*2) {
                if(x >= y) ans = c*2*x;
                else ans = c*2*x + b*(y-x);
            }else if(a <= c*2 && b >= c*2) {
                if(y >= x) ans = c*2*y;
                else ans = c*2*y + a*(x-y);
            }else {
                ans = c*2*max(x,y);
            }
        }
        System.out.println(ans);
    }
    
    static int max(int x, int y) {
        if(x >= y) return x;
        else return y;
    }
    
    static int min(int x, int y) {
        if(x >= y) return y;
        else return x;
    }
}
