import java.util.Scanner;
class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int a = scn.nextInt();
        int b = scn.nextInt();
        int ab = scn.nextInt();  
        int aNum = scn.nextInt();
        int bNum = scn.nextInt();
        int aTotal  = aNum*a;
        int bTotal = bNum*b;
        int abUp = 0;
        int abDown = 0;
        if(aNum>bNum){
            abUp = aNum*ab*2;
            abDown = bNum*ab*2+a*(aNum-bNum);
        }else{
            abUp = bNum*ab*2;
            abDown = aNum*ab*2+b*(bNum-aNum);
        }
        int min = aTotal+bTotal;
        min = Math.min(min,abUp);
        min = Math.min(min,abDown);
        System.out.println(min);
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int a = scn.nextInt();
        int b = scn.nextInt();
        int ab = scn.nextInt();  
        int aNum = scn.nextInt();
        int bNum = scn.nextInt();
        int aTotal  = aNum*a;
        int bTotal = bNum*b;
        int abUp = 0;
        int abDown = 0;
        if(aNum>bNum){
            abUp = aNum*ab*2;
            abDown = bNum*ab*2+a*(aNum-bNum);
        }else{
            abUp = bNum*ab*2;
            abDown = aNum*ab*2+b*(bNum-aNum);
        }
        int min = aTotal+bTotal;
        min = Math.min(min,abUp);
        min = Math.min(min,abDown);
        System.out.println(min);
    }
} Main public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int a = scn.nextInt();
        int b = scn.nextInt();
        int ab = scn.nextInt();  
        int aNum = scn.nextInt();
        int bNum = scn.nextInt();
        int aTotal  = aNum*a;
        int bTotal = bNum*b;
        int abUp = 0;
        int abDown = 0;
        if(aNum>bNum){
            abUp = aNum*ab*2;
            abDown = bNum*ab*2+a*(aNum-bNum);
        }else{
            abUp = bNum*ab*2;
            abDown = aNum*ab*2+b*(bNum-aNum);
        }
        int min = aTotal+bTotal;
        min = Math.min(min,abUp);
        min = Math.min(min,abDown);
        System.out.println(min);
    } main {
        Scanner scn=new Scanner(System.in);
        int a = scn.nextInt();
        int b = scn.nextInt();
        int ab = scn.nextInt();  
        int aNum = scn.nextInt();
        int bNum = scn.nextInt();
        int aTotal  = aNum*a;
        int bTotal = bNum*b;
        int abUp = 0;
        int abDown = 0;
        if(aNum>bNum){
            abUp = aNum*ab*2;
            abDown = bNum*ab*2+a*(aNum-bNum);
        }else{
            abUp = bNum*ab*2;
            abDown = aNum*ab*2+b*(bNum-aNum);
        }
        int min = aTotal+bTotal;
        min = Math.min(min,abUp);
        min = Math.min(min,abDown);
        System.out.println(min);
    } Scanner scn=new Scanner(System.in); scn new Scanner(System.in) int a = scn.nextInt(); a scn.nextInt() scn.nextInt scn int b = scn.nextInt(); b scn.nextInt() scn.nextInt scn int ab = scn.nextInt(); ab scn.nextInt() scn.nextInt scn int aNum = scn.nextInt(); aNum scn.nextInt() scn.nextInt scn int bNum = scn.nextInt(); bNum scn.nextInt() scn.nextInt scn int aTotal  = aNum*a; aTotal aNum*a aNum a int bTotal = bNum*b; bTotal bNum*b bNum b int abUp = 0; abUp 0 int abDown = 0; abDown 0 if(aNum>bNum){
            abUp = aNum*ab*2;
            abDown = bNum*ab*2+a*(aNum-bNum);
        }else{
            abUp = bNum*ab*2;
            abDown = aNum*ab*2+b*(bNum-aNum);
        } aNum>bNum aNum bNum {
            abUp = aNum*ab*2;
            abDown = bNum*ab*2+a*(aNum-bNum);
        } abUp = aNum*ab*2 abUp aNum*ab*2 aNum*ab*2 aNum ab 2 abDown = bNum*ab*2+a*(aNum-bNum) abDown bNum*ab*2+a*(aNum-bNum) bNum*ab*2 bNum*ab*2 bNum ab 2 a*(aNum-bNum) a (aNum-bNum) aNum bNum {
            abUp = bNum*ab*2;
            abDown = aNum*ab*2+b*(bNum-aNum);
        } abUp = bNum*ab*2 abUp bNum*ab*2 bNum*ab*2 bNum ab 2 abDown = aNum*ab*2+b*(bNum-aNum) abDown aNum*ab*2+b*(bNum-aNum) aNum*ab*2 aNum*ab*2 aNum ab 2 b*(bNum-aNum) b (bNum-aNum) bNum aNum int min = aTotal+bTotal; min aTotal+bTotal aTotal bTotal min = Math.min(min,abUp) min Math.min(min,abUp) Math.min Math min abUp min = Math.min(min,abDown) min Math.min(min,abDown) Math.min Math min abDown System.out.println(min) System.out.println System.out System System.out min String arg[] arg
import java.util.Scanner;
class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int a = scn.nextInt();
        int b = scn.nextInt();
        int ab = scn.nextInt();  
        int aNum = scn.nextInt();
        int bNum = scn.nextInt();
        int aTotal  = aNum*a;
        int bTotal = bNum*b;
        int abUp = 0;
        int abDown = 0;
        if(aNum>bNum){
            abUp = aNum*ab*2;
            abDown = bNum*ab*2+a*(aNum-bNum);
        }else{
            abUp = bNum*ab*2;
            abDown = aNum*ab*2+b*(bNum-aNum);
        }
        int min = aTotal+bTotal;
        min = Math.min(min,abUp);
        min = Math.min(min,abDown);
        System.out.println(min);
    }
}