import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line[] = br.readLine().split(" ");
        int a = Integer.parseInt(line[0]);
        int b = Integer.parseInt(line[1]);
        int c = Integer.parseInt(line[2]);
        int x = Integer.parseInt(line[3]);
        int y = Integer.parseInt(line[4]);
        long price, minPrice = a * x + b * y;
        
        for (int i = 2; i <= Math.max(x, y)*2; i += 2) {
            price = a * Math.max(0, (x - i/2)) + b * Math.max(0, (y - i/2)) + c * i;
            if (price < minPrice) {
                minPrice = price;
            }
        }
        
        
        
        
        System.out.println(minPrice);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line[] = br.readLine().split(" ");
        int a = Integer.parseInt(line[0]);
        int b = Integer.parseInt(line[1]);
        int c = Integer.parseInt(line[2]);
        int x = Integer.parseInt(line[3]);
        int y = Integer.parseInt(line[4]);
        long price, minPrice = a * x + b * y;
        
        for (int i = 2; i <= Math.max(x, y)*2; i += 2) {
            price = a * Math.max(0, (x - i/2)) + b * Math.max(0, (y - i/2)) + c * i;
            if (price < minPrice) {
                minPrice = price;
            }
        }
        
        
        
        
        System.out.println(minPrice);
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line[] = br.readLine().split(" ");
        int a = Integer.parseInt(line[0]);
        int b = Integer.parseInt(line[1]);
        int c = Integer.parseInt(line[2]);
        int x = Integer.parseInt(line[3]);
        int y = Integer.parseInt(line[4]);
        long price, minPrice = a * x + b * y;
        
        for (int i = 2; i <= Math.max(x, y)*2; i += 2) {
            price = a * Math.max(0, (x - i/2)) + b * Math.max(0, (y - i/2)) + c * i;
            if (price < minPrice) {
                minPrice = price;
            }
        }
        
        
        
        
        System.out.println(minPrice);
    } main {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line[] = br.readLine().split(" ");
        int a = Integer.parseInt(line[0]);
        int b = Integer.parseInt(line[1]);
        int c = Integer.parseInt(line[2]);
        int x = Integer.parseInt(line[3]);
        int y = Integer.parseInt(line[4]);
        long price, minPrice = a * x + b * y;
        
        for (int i = 2; i <= Math.max(x, y)*2; i += 2) {
            price = a * Math.max(0, (x - i/2)) + b * Math.max(0, (y - i/2)) + c * i;
            if (price < minPrice) {
                minPrice = price;
            }
        }
        
        
        
        
        System.out.println(minPrice);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line[] = br.readLine().split(" "); line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int a = Integer.parseInt(line[0]); a Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 int b = Integer.parseInt(line[1]); b Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 int c = Integer.parseInt(line[2]); c Integer.parseInt(line[2]) Integer.parseInt Integer line[2] line 2 int x = Integer.parseInt(line[3]); x Integer.parseInt(line[3]) Integer.parseInt Integer line[3] line 3 int y = Integer.parseInt(line[4]); y Integer.parseInt(line[4]) Integer.parseInt Integer line[4] line 4 long price price minPrice = a * x + b * y; minPrice a * x + b * y a * x a x b * y b y for (int i = 2; i <= Math.max(x, y)*2; i += 2) {
            price = a * Math.max(0, (x - i/2)) + b * Math.max(0, (y - i/2)) + c * i;
            if (price < minPrice) {
                minPrice = price;
            }
        } int i = 2; int i = 2; i 2 i <= Math.max(x, y)*2 i Math.max(x, y)*2 Math.max(x, y) Math.max Math x y 2 i += 2 i += 2 i 2 {
            price = a * Math.max(0, (x - i/2)) + b * Math.max(0, (y - i/2)) + c * i;
            if (price < minPrice) {
                minPrice = price;
            }
        } {
            price = a * Math.max(0, (x - i/2)) + b * Math.max(0, (y - i/2)) + c * i;
            if (price < minPrice) {
                minPrice = price;
            }
        } price = a * Math.max(0, (x - i/2)) + b * Math.max(0, (y - i/2)) + c * i price a * Math.max(0, (x - i/2)) + b * Math.max(0, (y - i/2)) + c * i a * Math.max(0, (x - i/2)) + b * Math.max(0, (y - i/2)) + c * i a * Math.max(0, (x - i/2)) a Math.max(0, (x - i/2)) Math.max Math 0 (x - i/2) x i/2 i 2 b * Math.max(0, (y - i/2)) b Math.max(0, (y - i/2)) Math.max Math 0 (y - i/2) y i/2 i 2 c * i c i if (price < minPrice) {
                minPrice = price;
            } price < minPrice price minPrice {
                minPrice = price;
            } minPrice = price minPrice price System.out.println(minPrice) System.out.println System.out System System.out minPrice String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line[] = br.readLine().split(" ");
        int a = Integer.parseInt(line[0]);
        int b = Integer.parseInt(line[1]);
        int c = Integer.parseInt(line[2]);
        int x = Integer.parseInt(line[3]);
        int y = Integer.parseInt(line[4]);
        long price, minPrice = a * x + b * y;
        
        for (int i = 2; i <= Math.max(x, y)*2; i += 2) {
            price = a * Math.max(0, (x - i/2)) + b * Math.max(0, (y - i/2)) + c * i;
            if (price < minPrice) {
                minPrice = price;
            }
        }
        
        
        
        
        System.out.println(minPrice);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line[] = br.readLine().split(" ");
        int a = Integer.parseInt(line[0]);
        int b = Integer.parseInt(line[1]);
        int c = Integer.parseInt(line[2]);
        int x = Integer.parseInt(line[3]);
        int y = Integer.parseInt(line[4]);
        long price, minPrice = a * x + b * y;
        
        for (int i = 2; i <= Math.max(x, y)*2; i += 2) {
            price = a * Math.max(0, (x - i/2)) + b * Math.max(0, (y - i/2)) + c * i;
            if (price < minPrice) {
                minPrice = price;
            }
        }
        
        
        
        
        System.out.println(minPrice);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line[] = br.readLine().split(" ");
        int a = Integer.parseInt(line[0]);
        int b = Integer.parseInt(line[1]);
        int c = Integer.parseInt(line[2]);
        int x = Integer.parseInt(line[3]);
        int y = Integer.parseInt(line[4]);
        long price, minPrice = a * x + b * y;
        
        for (int i = 2; i <= Math.max(x, y)*2; i += 2) {
            price = a * Math.max(0, (x - i/2)) + b * Math.max(0, (y - i/2)) + c * i;
            if (price < minPrice) {
                minPrice = price;
            }
        }
        
        
        
        
        System.out.println(minPrice);
    }
}
