import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        double a = scanner.nextDouble();
        double b = scanner.nextDouble();
        double c = scanner.nextDouble();
        double x = scanner.nextDouble();
        double y = scanner.nextDouble();
        double max = Math.max(x,y)*2;

        double prev = Double.MAX_VALUE;
        for(int i = 0; i <= max; i+=2){
            //if(x < 0 || y < 0){break;}
            double cur = a * x + b * y + c * i;
            //System.out.println("x : " + x + " y : " + y + " i : " + i + " total : " + cur);
            if(x > 0){x--;}
            if(y > 0){y--;}
            if(prev <= cur){break;}
            else{prev = cur;}
        }
        System.out.println((int)prev);
    }
}
 import java.util.*; util.* java class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        double a = scanner.nextDouble();
        double b = scanner.nextDouble();
        double c = scanner.nextDouble();
        double x = scanner.nextDouble();
        double y = scanner.nextDouble();
        double max = Math.max(x,y)*2;

        double prev = Double.MAX_VALUE;
        for(int i = 0; i <= max; i+=2){
            //if(x < 0 || y < 0){break;}
            double cur = a * x + b * y + c * i;
            //System.out.println("x : " + x + " y : " + y + " i : " + i + " total : " + cur);
            if(x > 0){x--;}
            if(y > 0){y--;}
            if(prev <= cur){break;}
            else{prev = cur;}
        }
        System.out.println((int)prev);
    }
} Main public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        double a = scanner.nextDouble();
        double b = scanner.nextDouble();
        double c = scanner.nextDouble();
        double x = scanner.nextDouble();
        double y = scanner.nextDouble();
        double max = Math.max(x,y)*2;

        double prev = Double.MAX_VALUE;
        for(int i = 0; i <= max; i+=2){
            //if(x < 0 || y < 0){break;}
            double cur = a * x + b * y + c * i;
            //System.out.println("x : " + x + " y : " + y + " i : " + i + " total : " + cur);
            if(x > 0){x--;}
            if(y > 0){y--;}
            if(prev <= cur){break;}
            else{prev = cur;}
        }
        System.out.println((int)prev);
    } main {
        Scanner scanner = new Scanner(System.in);
        double a = scanner.nextDouble();
        double b = scanner.nextDouble();
        double c = scanner.nextDouble();
        double x = scanner.nextDouble();
        double y = scanner.nextDouble();
        double max = Math.max(x,y)*2;

        double prev = Double.MAX_VALUE;
        for(int i = 0; i <= max; i+=2){
            //if(x < 0 || y < 0){break;}
            double cur = a * x + b * y + c * i;
            //System.out.println("x : " + x + " y : " + y + " i : " + i + " total : " + cur);
            if(x > 0){x--;}
            if(y > 0){y--;}
            if(prev <= cur){break;}
            else{prev = cur;}
        }
        System.out.println((int)prev);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) double a = scanner.nextDouble(); a scanner.nextDouble() scanner.nextDouble scanner double b = scanner.nextDouble(); b scanner.nextDouble() scanner.nextDouble scanner double c = scanner.nextDouble(); c scanner.nextDouble() scanner.nextDouble scanner double x = scanner.nextDouble(); x scanner.nextDouble() scanner.nextDouble scanner double y = scanner.nextDouble(); y scanner.nextDouble() scanner.nextDouble scanner double max = Math.max(x,y)*2; max Math.max(x,y)*2 Math.max(x,y) Math.max Math x y 2 double prev = Double.MAX_VALUE; prev Double.MAX_VALUE Double Double.MAX_VALUE for(int i = 0; i <= max; i+=2){
            //if(x < 0 || y < 0){break;}
            double cur = a * x + b * y + c * i;
            //System.out.println("x : " + x + " y : " + y + " i : " + i + " total : " + cur);
            if(x > 0){x--;}
            if(y > 0){y--;}
            if(prev <= cur){break;}
            else{prev = cur;}
        } int i = 0; int i = 0; i 0 i <= max i max i+=2 i+=2 i 2 {
            //if(x < 0 || y < 0){break;}
            double cur = a * x + b * y + c * i;
            //System.out.println("x : " + x + " y : " + y + " i : " + i + " total : " + cur);
            if(x > 0){x--;}
            if(y > 0){y--;}
            if(prev <= cur){break;}
            else{prev = cur;}
        } {
            //if(x < 0 || y < 0){break;}
            double cur = a * x + b * y + c * i;
            //System.out.println("x : " + x + " y : " + y + " i : " + i + " total : " + cur);
            if(x > 0){x--;}
            if(y > 0){y--;}
            if(prev <= cur){break;}
            else{prev = cur;}
        } double cur = a * x + b * y + c * i; cur a * x + b * y + c * i a * x + b * y + c * i a * x a x b * y b y c * i c i if(x > 0){x--;} x > 0 x 0 {x--;} x-- x if(y > 0){y--;} y > 0 y 0 {y--;} y-- y if(prev <= cur){break;}
            else{prev = cur;} prev <= cur prev cur {break;} break; {prev = cur;} prev = cur prev cur System.out.println((int)prev) System.out.println System.out System System.out (int)prev String[] args args
import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        double a = scanner.nextDouble();
        double b = scanner.nextDouble();
        double c = scanner.nextDouble();
        double x = scanner.nextDouble();
        double y = scanner.nextDouble();
        double max = Math.max(x,y)*2;

        double prev = Double.MAX_VALUE;
        for(int i = 0; i <= max; i+=2){
            //if(x < 0 || y < 0){break;}
            double cur = a * x + b * y + c * i;
            //System.out.println("x : " + x + " y : " + y + " i : " + i + " total : " + cur);
            if(x > 0){x--;}
            if(y > 0){y--;}
            if(prev <= cur){break;}
            else{prev = cur;}
        }
        System.out.println((int)prev);
    }
}

