import java.util.Scanner;

class Main {
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int a = stdIn.nextInt();
        int b = stdIn.nextInt();
        int c = stdIn.nextInt();
        int x = stdIn.nextInt();
        int y = stdIn.nextInt();
        int price = 0;
        
        if((a + b + 1) / 2 > c){
            if(x > y){
                price = c * y * 2;
                if(a > c * 2)
                    price += c * (x - y) * 2;
                else
                    for(int i = 0; i < x - y; i++)
                        price += a;
            }
            else{
                price = c * x * 2;
                if(b > c * 2)
                    price += c * (y - x) * 2;
                else
                    for(int i = 0; i < y - x; i++)
                        price += b;
            }
        }
        else{
            for(int i = 0; i < x; i++)
                price += a;
         
            for(int i = 0; i < y; i++)
                price += b;
        }
            
        System.out.println(price);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int a = stdIn.nextInt();
        int b = stdIn.nextInt();
        int c = stdIn.nextInt();
        int x = stdIn.nextInt();
        int y = stdIn.nextInt();
        int price = 0;
        
        if((a + b + 1) / 2 > c){
            if(x > y){
                price = c * y * 2;
                if(a > c * 2)
                    price += c * (x - y) * 2;
                else
                    for(int i = 0; i < x - y; i++)
                        price += a;
            }
            else{
                price = c * x * 2;
                if(b > c * 2)
                    price += c * (y - x) * 2;
                else
                    for(int i = 0; i < y - x; i++)
                        price += b;
            }
        }
        else{
            for(int i = 0; i < x; i++)
                price += a;
         
            for(int i = 0; i < y; i++)
                price += b;
        }
            
        System.out.println(price);
    }
} Main public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int a = stdIn.nextInt();
        int b = stdIn.nextInt();
        int c = stdIn.nextInt();
        int x = stdIn.nextInt();
        int y = stdIn.nextInt();
        int price = 0;
        
        if((a + b + 1) / 2 > c){
            if(x > y){
                price = c * y * 2;
                if(a > c * 2)
                    price += c * (x - y) * 2;
                else
                    for(int i = 0; i < x - y; i++)
                        price += a;
            }
            else{
                price = c * x * 2;
                if(b > c * 2)
                    price += c * (y - x) * 2;
                else
                    for(int i = 0; i < y - x; i++)
                        price += b;
            }
        }
        else{
            for(int i = 0; i < x; i++)
                price += a;
         
            for(int i = 0; i < y; i++)
                price += b;
        }
            
        System.out.println(price);
    } main {
        Scanner stdIn = new Scanner(System.in);
        int a = stdIn.nextInt();
        int b = stdIn.nextInt();
        int c = stdIn.nextInt();
        int x = stdIn.nextInt();
        int y = stdIn.nextInt();
        int price = 0;
        
        if((a + b + 1) / 2 > c){
            if(x > y){
                price = c * y * 2;
                if(a > c * 2)
                    price += c * (x - y) * 2;
                else
                    for(int i = 0; i < x - y; i++)
                        price += a;
            }
            else{
                price = c * x * 2;
                if(b > c * 2)
                    price += c * (y - x) * 2;
                else
                    for(int i = 0; i < y - x; i++)
                        price += b;
            }
        }
        else{
            for(int i = 0; i < x; i++)
                price += a;
         
            for(int i = 0; i < y; i++)
                price += b;
        }
            
        System.out.println(price);
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int a = stdIn.nextInt(); a stdIn.nextInt() stdIn.nextInt stdIn int b = stdIn.nextInt(); b stdIn.nextInt() stdIn.nextInt stdIn int c = stdIn.nextInt(); c stdIn.nextInt() stdIn.nextInt stdIn int x = stdIn.nextInt(); x stdIn.nextInt() stdIn.nextInt stdIn int y = stdIn.nextInt(); y stdIn.nextInt() stdIn.nextInt stdIn int price = 0; price 0 if((a + b + 1) / 2 > c){
            if(x > y){
                price = c * y * 2;
                if(a > c * 2)
                    price += c * (x - y) * 2;
                else
                    for(int i = 0; i < x - y; i++)
                        price += a;
            }
            else{
                price = c * x * 2;
                if(b > c * 2)
                    price += c * (y - x) * 2;
                else
                    for(int i = 0; i < y - x; i++)
                        price += b;
            }
        }
        else{
            for(int i = 0; i < x; i++)
                price += a;
         
            for(int i = 0; i < y; i++)
                price += b;
        } (a + b + 1) / 2 > c (a + b + 1) / 2 (a + b + 1) a + b + 1 a b 1 2 c {
            if(x > y){
                price = c * y * 2;
                if(a > c * 2)
                    price += c * (x - y) * 2;
                else
                    for(int i = 0; i < x - y; i++)
                        price += a;
            }
            else{
                price = c * x * 2;
                if(b > c * 2)
                    price += c * (y - x) * 2;
                else
                    for(int i = 0; i < y - x; i++)
                        price += b;
            }
        } if(x > y){
                price = c * y * 2;
                if(a > c * 2)
                    price += c * (x - y) * 2;
                else
                    for(int i = 0; i < x - y; i++)
                        price += a;
            }
            else{
                price = c * x * 2;
                if(b > c * 2)
                    price += c * (y - x) * 2;
                else
                    for(int i = 0; i < y - x; i++)
                        price += b;
            } x > y x y {
                price = c * y * 2;
                if(a > c * 2)
                    price += c * (x - y) * 2;
                else
                    for(int i = 0; i < x - y; i++)
                        price += a;
            } price = c * y * 2 price c * y * 2 c * y * 2 c y 2 if(a > c * 2)
                    price += c * (x - y) * 2;
                else
                    for(int i = 0; i < x - y; i++)
                        price += a; a > c * 2 a c * 2 c 2 price += c * (x - y) * 2 price c * (x - y) * 2 c * (x - y) * 2 c (x - y) x y 2 for(int i = 0; i < x - y; i++)
                        price += a; int i = 0; int i = 0; i 0 i < x - y i x - y x y i++ i++ i price += a; price += a price a {
                price = c * x * 2;
                if(b > c * 2)
                    price += c * (y - x) * 2;
                else
                    for(int i = 0; i < y - x; i++)
                        price += b;
            } price = c * x * 2 price c * x * 2 c * x * 2 c x 2 if(b > c * 2)
                    price += c * (y - x) * 2;
                else
                    for(int i = 0; i < y - x; i++)
                        price += b; b > c * 2 b c * 2 c 2 price += c * (y - x) * 2 price c * (y - x) * 2 c * (y - x) * 2 c (y - x) y x 2 for(int i = 0; i < y - x; i++)
                        price += b; int i = 0; int i = 0; i 0 i < y - x i y - x y x i++ i++ i price += b; price += b price b {
            for(int i = 0; i < x; i++)
                price += a;
         
            for(int i = 0; i < y; i++)
                price += b;
        } for(int i = 0; i < x; i++)
                price += a; int i = 0; int i = 0; i 0 i < x i x i++ i++ i price += a; price += a price a for(int i = 0; i < y; i++)
                price += b; int i = 0; int i = 0; i 0 i < y i y i++ i++ i price += b; price += b price b System.out.println(price) System.out.println System.out System System.out price String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);
        int a = stdIn.nextInt();
        int b = stdIn.nextInt();
        int c = stdIn.nextInt();
        int x = stdIn.nextInt();
        int y = stdIn.nextInt();
        int price = 0;
        
        if((a + b + 1) / 2 > c){
            if(x > y){
                price = c * y * 2;
                if(a > c * 2)
                    price += c * (x - y) * 2;
                else
                    for(int i = 0; i < x - y; i++)
                        price += a;
            }
            else{
                price = c * x * 2;
                if(b > c * 2)
                    price += c * (y - x) * 2;
                else
                    for(int i = 0; i < y - x; i++)
                        price += b;
            }
        }
        else{
            for(int i = 0; i < x; i++)
                price += a;
         
            for(int i = 0; i < y; i++)
                price += b;
        }
            
        System.out.println(price);
    }
}