import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int aPrice = sc.nextInt();
        int bPrice = sc.nextInt();
        int abPrice = sc.nextInt();
        int aNeed = sc.nextInt();
        int bNeed = sc.nextInt();
        
        int minPrice = Math.min((aPrice + bPrice), abPrice * 2);
        long total = Math.min(aNeed, bNeed) * minPrice;

        if (aNeed <= bNeed) {
            int remainNeed = bNeed - aNeed;
            total += remainNeed * Math.min(bPrice, abPrice * 2);
        } else {
            int remainNeed = aNeed - bNeed;
            total += remainNeed * Math.min(aPrice, abPrice * 2);
        }

        System.out.print(total);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int aPrice = sc.nextInt();
        int bPrice = sc.nextInt();
        int abPrice = sc.nextInt();
        int aNeed = sc.nextInt();
        int bNeed = sc.nextInt();
        
        int minPrice = Math.min((aPrice + bPrice), abPrice * 2);
        long total = Math.min(aNeed, bNeed) * minPrice;

        if (aNeed <= bNeed) {
            int remainNeed = bNeed - aNeed;
            total += remainNeed * Math.min(bPrice, abPrice * 2);
        } else {
            int remainNeed = aNeed - bNeed;
            total += remainNeed * Math.min(aPrice, abPrice * 2);
        }

        System.out.print(total);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int aPrice = sc.nextInt();
        int bPrice = sc.nextInt();
        int abPrice = sc.nextInt();
        int aNeed = sc.nextInt();
        int bNeed = sc.nextInt();
        
        int minPrice = Math.min((aPrice + bPrice), abPrice * 2);
        long total = Math.min(aNeed, bNeed) * minPrice;

        if (aNeed <= bNeed) {
            int remainNeed = bNeed - aNeed;
            total += remainNeed * Math.min(bPrice, abPrice * 2);
        } else {
            int remainNeed = aNeed - bNeed;
            total += remainNeed * Math.min(aPrice, abPrice * 2);
        }

        System.out.print(total);
    } main {
        Scanner sc = new Scanner(System.in);
        int aPrice = sc.nextInt();
        int bPrice = sc.nextInt();
        int abPrice = sc.nextInt();
        int aNeed = sc.nextInt();
        int bNeed = sc.nextInt();
        
        int minPrice = Math.min((aPrice + bPrice), abPrice * 2);
        long total = Math.min(aNeed, bNeed) * minPrice;

        if (aNeed <= bNeed) {
            int remainNeed = bNeed - aNeed;
            total += remainNeed * Math.min(bPrice, abPrice * 2);
        } else {
            int remainNeed = aNeed - bNeed;
            total += remainNeed * Math.min(aPrice, abPrice * 2);
        }

        System.out.print(total);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int aPrice = sc.nextInt(); aPrice sc.nextInt() sc.nextInt sc int bPrice = sc.nextInt(); bPrice sc.nextInt() sc.nextInt sc int abPrice = sc.nextInt(); abPrice sc.nextInt() sc.nextInt sc int aNeed = sc.nextInt(); aNeed sc.nextInt() sc.nextInt sc int bNeed = sc.nextInt(); bNeed sc.nextInt() sc.nextInt sc int minPrice = Math.min((aPrice + bPrice), abPrice * 2); minPrice Math.min((aPrice + bPrice), abPrice * 2) Math.min Math (aPrice + bPrice) aPrice bPrice abPrice * 2 abPrice 2 long total = Math.min(aNeed, bNeed) * minPrice; total Math.min(aNeed, bNeed) * minPrice Math.min(aNeed, bNeed) Math.min Math aNeed bNeed minPrice if (aNeed <= bNeed) {
            int remainNeed = bNeed - aNeed;
            total += remainNeed * Math.min(bPrice, abPrice * 2);
        } else {
            int remainNeed = aNeed - bNeed;
            total += remainNeed * Math.min(aPrice, abPrice * 2);
        } aNeed <= bNeed aNeed bNeed {
            int remainNeed = bNeed - aNeed;
            total += remainNeed * Math.min(bPrice, abPrice * 2);
        } int remainNeed = bNeed - aNeed; remainNeed bNeed - aNeed bNeed aNeed total += remainNeed * Math.min(bPrice, abPrice * 2) total remainNeed * Math.min(bPrice, abPrice * 2) remainNeed Math.min(bPrice, abPrice * 2) Math.min Math bPrice abPrice * 2 abPrice 2 {
            int remainNeed = aNeed - bNeed;
            total += remainNeed * Math.min(aPrice, abPrice * 2);
        } int remainNeed = aNeed - bNeed; remainNeed aNeed - bNeed aNeed bNeed total += remainNeed * Math.min(aPrice, abPrice * 2) total remainNeed * Math.min(aPrice, abPrice * 2) remainNeed Math.min(aPrice, abPrice * 2) Math.min Math aPrice abPrice * 2 abPrice 2 System.out.print(total) System.out.print System.out System System.out total String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int aPrice = sc.nextInt();
        int bPrice = sc.nextInt();
        int abPrice = sc.nextInt();
        int aNeed = sc.nextInt();
        int bNeed = sc.nextInt();
        
        int minPrice = Math.min((aPrice + bPrice), abPrice * 2);
        long total = Math.min(aNeed, bNeed) * minPrice;

        if (aNeed <= bNeed) {
            int remainNeed = bNeed - aNeed;
            total += remainNeed * Math.min(bPrice, abPrice * 2);
        } else {
            int remainNeed = aNeed - bNeed;
            total += remainNeed * Math.min(aPrice, abPrice * 2);
        }

        System.out.print(total);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int aPrice = sc.nextInt();
        int bPrice = sc.nextInt();
        int abPrice = sc.nextInt();
        int aNeed = sc.nextInt();
        int bNeed = sc.nextInt();
        
        int minPrice = Math.min((aPrice + bPrice), abPrice * 2);
        long total = Math.min(aNeed, bNeed) * minPrice;

        if (aNeed <= bNeed) {
            int remainNeed = bNeed - aNeed;
            total += remainNeed * Math.min(bPrice, abPrice * 2);
        } else {
            int remainNeed = aNeed - bNeed;
            total += remainNeed * Math.min(aPrice, abPrice * 2);
        }

        System.out.print(total);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int aPrice = sc.nextInt();
        int bPrice = sc.nextInt();
        int abPrice = sc.nextInt();
        int aNeed = sc.nextInt();
        int bNeed = sc.nextInt();
        
        int minPrice = Math.min((aPrice + bPrice), abPrice * 2);
        long total = Math.min(aNeed, bNeed) * minPrice;

        if (aNeed <= bNeed) {
            int remainNeed = bNeed - aNeed;
            total += remainNeed * Math.min(bPrice, abPrice * 2);
        } else {
            int remainNeed = aNeed - bNeed;
            total += remainNeed * Math.min(aPrice, abPrice * 2);
        }

        System.out.print(total);
    }
}
