import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
    public static void main(String args[]) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String[] abcxy = br.readLine().split(" ");
        int a = Integer.parseInt(abcxy[0]);
        int b = Integer.parseInt(abcxy[1]);
        int c = Integer.parseInt(abcxy[2]);
        int x = Integer.parseInt(abcxy[3]);
        int y = Integer.parseInt(abcxy[4]);
        
        int cost = 0;
        
        if(a+b > c*2){
            int min = x < y ? x : y;
            x -= min; 
            y -= min;
            
            cost += c * min * 2;
            int rest = x > 0 ? a : b;
            if(rest > c*2)
                cost += c * (x+y) * 2;
            else
                cost += a*x + b*y;
        }
        else{
            cost += a*x + b*y;
        }
        System.out.println(cost);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
    public static void main(String args[]) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String[] abcxy = br.readLine().split(" ");
        int a = Integer.parseInt(abcxy[0]);
        int b = Integer.parseInt(abcxy[1]);
        int c = Integer.parseInt(abcxy[2]);
        int x = Integer.parseInt(abcxy[3]);
        int y = Integer.parseInt(abcxy[4]);
        
        int cost = 0;
        
        if(a+b > c*2){
            int min = x < y ? x : y;
            x -= min; 
            y -= min;
            
            cost += c * min * 2;
            int rest = x > 0 ? a : b;
            if(rest > c*2)
                cost += c * (x+y) * 2;
            else
                cost += a*x + b*y;
        }
        else{
            cost += a*x + b*y;
        }
        System.out.println(cost);
    }
} Main public static void main(String args[]) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String[] abcxy = br.readLine().split(" ");
        int a = Integer.parseInt(abcxy[0]);
        int b = Integer.parseInt(abcxy[1]);
        int c = Integer.parseInt(abcxy[2]);
        int x = Integer.parseInt(abcxy[3]);
        int y = Integer.parseInt(abcxy[4]);
        
        int cost = 0;
        
        if(a+b > c*2){
            int min = x < y ? x : y;
            x -= min; 
            y -= min;
            
            cost += c * min * 2;
            int rest = x > 0 ? a : b;
            if(rest > c*2)
                cost += c * (x+y) * 2;
            else
                cost += a*x + b*y;
        }
        else{
            cost += a*x + b*y;
        }
        System.out.println(cost);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String[] abcxy = br.readLine().split(" ");
        int a = Integer.parseInt(abcxy[0]);
        int b = Integer.parseInt(abcxy[1]);
        int c = Integer.parseInt(abcxy[2]);
        int x = Integer.parseInt(abcxy[3]);
        int y = Integer.parseInt(abcxy[4]);
        
        int cost = 0;
        
        if(a+b > c*2){
            int min = x < y ? x : y;
            x -= min; 
            y -= min;
            
            cost += c * min * 2;
            int rest = x > 0 ? a : b;
            if(rest > c*2)
                cost += c * (x+y) * 2;
            else
                cost += a*x + b*y;
        }
        else{
            cost += a*x + b*y;
        }
        System.out.println(cost);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] abcxy = br.readLine().split(" "); abcxy br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int a = Integer.parseInt(abcxy[0]); a Integer.parseInt(abcxy[0]) Integer.parseInt Integer abcxy[0] abcxy 0 int b = Integer.parseInt(abcxy[1]); b Integer.parseInt(abcxy[1]) Integer.parseInt Integer abcxy[1] abcxy 1 int c = Integer.parseInt(abcxy[2]); c Integer.parseInt(abcxy[2]) Integer.parseInt Integer abcxy[2] abcxy 2 int x = Integer.parseInt(abcxy[3]); x Integer.parseInt(abcxy[3]) Integer.parseInt Integer abcxy[3] abcxy 3 int y = Integer.parseInt(abcxy[4]); y Integer.parseInt(abcxy[4]) Integer.parseInt Integer abcxy[4] abcxy 4 int cost = 0; cost 0 if(a+b > c*2){
            int min = x < y ? x : y;
            x -= min; 
            y -= min;
            
            cost += c * min * 2;
            int rest = x > 0 ? a : b;
            if(rest > c*2)
                cost += c * (x+y) * 2;
            else
                cost += a*x + b*y;
        }
        else{
            cost += a*x + b*y;
        } a+b > c*2 a+b a b c*2 c 2 {
            int min = x < y ? x : y;
            x -= min; 
            y -= min;
            
            cost += c * min * 2;
            int rest = x > 0 ? a : b;
            if(rest > c*2)
                cost += c * (x+y) * 2;
            else
                cost += a*x + b*y;
        } int min = x < y ? x : y; min x < y ? x : y x < y x y x y x -= min x min y -= min y min cost += c * min * 2 cost c * min * 2 c * min * 2 c min 2 int rest = x > 0 ? a : b; rest x > 0 ? a : b x > 0 x 0 a b if(rest > c*2)
                cost += c * (x+y) * 2;
            else
                cost += a*x + b*y; rest > c*2 rest c*2 c 2 cost += c * (x+y) * 2 cost c * (x+y) * 2 c * (x+y) * 2 c (x+y) x y 2 cost += a*x + b*y cost a*x + b*y a*x a x b*y b y {
            cost += a*x + b*y;
        } cost += a*x + b*y cost a*x + b*y a*x a x b*y b y System.out.println(cost) System.out.println System.out System System.out cost String args[] args public class Main {
    public static void main(String args[]) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String[] abcxy = br.readLine().split(" ");
        int a = Integer.parseInt(abcxy[0]);
        int b = Integer.parseInt(abcxy[1]);
        int c = Integer.parseInt(abcxy[2]);
        int x = Integer.parseInt(abcxy[3]);
        int y = Integer.parseInt(abcxy[4]);
        
        int cost = 0;
        
        if(a+b > c*2){
            int min = x < y ? x : y;
            x -= min; 
            y -= min;
            
            cost += c * min * 2;
            int rest = x > 0 ? a : b;
            if(rest > c*2)
                cost += c * (x+y) * 2;
            else
                cost += a*x + b*y;
        }
        else{
            cost += a*x + b*y;
        }
        System.out.println(cost);
    }
} public class Main {
    public static void main(String args[]) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String[] abcxy = br.readLine().split(" ");
        int a = Integer.parseInt(abcxy[0]);
        int b = Integer.parseInt(abcxy[1]);
        int c = Integer.parseInt(abcxy[2]);
        int x = Integer.parseInt(abcxy[3]);
        int y = Integer.parseInt(abcxy[4]);
        
        int cost = 0;
        
        if(a+b > c*2){
            int min = x < y ? x : y;
            x -= min; 
            y -= min;
            
            cost += c * min * 2;
            int rest = x > 0 ? a : b;
            if(rest > c*2)
                cost += c * (x+y) * 2;
            else
                cost += a*x + b*y;
        }
        else{
            cost += a*x + b*y;
        }
        System.out.println(cost);
    }
} Main
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
    public static void main(String args[]) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String[] abcxy = br.readLine().split(" ");
        int a = Integer.parseInt(abcxy[0]);
        int b = Integer.parseInt(abcxy[1]);
        int c = Integer.parseInt(abcxy[2]);
        int x = Integer.parseInt(abcxy[3]);
        int y = Integer.parseInt(abcxy[4]);
        
        int cost = 0;
        
        if(a+b > c*2){
            int min = x < y ? x : y;
            x -= min; 
            y -= min;
            
            cost += c * min * 2;
            int rest = x > 0 ? a : b;
            if(rest > c*2)
                cost += c * (x+y) * 2;
            else
                cost += a*x + b*y;
        }
        else{
            cost += a*x + b*y;
        }
        System.out.println(cost);
    }
}
