import java.util.*;

public class Main {
  public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    int X = sc.nextInt();  //Aの個数
    int Y = sc.nextInt();  //Bの個数
    int MAX = Math.max(X,Y);
    int MIN = Math.min(X,Y);
    int diff = MAX - MIN;
    int result = 0;

    if(MAX == X){
      result += Math.min((diff * A) , (diff * C * 2));
    
    }else{
      result += Math.min((diff * B) , (diff * C * 2));
    }
    
    if((C * (MIN * 2)) > ((A * MIN) + (B * MIN))){
      result += (A * MIN) + (B * MIN);
      
    }else{
      result += C * (MIN * 2);
    }
    
    System.out.println(result);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    int X = sc.nextInt();  //Aの個数
    int Y = sc.nextInt();  //Bの個数
    int MAX = Math.max(X,Y);
    int MIN = Math.min(X,Y);
    int diff = MAX - MIN;
    int result = 0;

    if(MAX == X){
      result += Math.min((diff * A) , (diff * C * 2));
    
    }else{
      result += Math.min((diff * B) , (diff * C * 2));
    }
    
    if((C * (MIN * 2)) > ((A * MIN) + (B * MIN))){
      result += (A * MIN) + (B * MIN);
      
    }else{
      result += C * (MIN * 2);
    }
    
    System.out.println(result);
  }
} Main public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    int X = sc.nextInt();  //Aの個数
    int Y = sc.nextInt();  //Bの個数
    int MAX = Math.max(X,Y);
    int MIN = Math.min(X,Y);
    int diff = MAX - MIN;
    int result = 0;

    if(MAX == X){
      result += Math.min((diff * A) , (diff * C * 2));
    
    }else{
      result += Math.min((diff * B) , (diff * C * 2));
    }
    
    if((C * (MIN * 2)) > ((A * MIN) + (B * MIN))){
      result += (A * MIN) + (B * MIN);
      
    }else{
      result += C * (MIN * 2);
    }
    
    System.out.println(result);
  } main {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    int X = sc.nextInt();  //Aの個数
    int Y = sc.nextInt();  //Bの個数
    int MAX = Math.max(X,Y);
    int MIN = Math.min(X,Y);
    int diff = MAX - MIN;
    int result = 0;

    if(MAX == X){
      result += Math.min((diff * A) , (diff * C * 2));
    
    }else{
      result += Math.min((diff * B) , (diff * C * 2));
    }
    
    if((C * (MIN * 2)) > ((A * MIN) + (B * MIN))){
      result += (A * MIN) + (B * MIN);
      
    }else{
      result += C * (MIN * 2);
    }
    
    System.out.println(result);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int C = sc.nextInt(); C sc.nextInt() sc.nextInt sc int X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int Y = sc.nextInt(); Y sc.nextInt() sc.nextInt sc int MAX = Math.max(X,Y); MAX Math.max(X,Y) Math.max Math X Y int MIN = Math.min(X,Y); MIN Math.min(X,Y) Math.min Math X Y int diff = MAX - MIN; diff MAX - MIN MAX MIN int result = 0; result 0 if(MAX == X){
      result += Math.min((diff * A) , (diff * C * 2));
    
    }else{
      result += Math.min((diff * B) , (diff * C * 2));
    } MAX == X MAX X {
      result += Math.min((diff * A) , (diff * C * 2));
    
    } result += Math.min((diff * A) , (diff * C * 2)) result Math.min((diff * A) , (diff * C * 2)) Math.min Math (diff * A) diff A (diff * C * 2) diff * C * 2 diff C 2 {
      result += Math.min((diff * B) , (diff * C * 2));
    } result += Math.min((diff * B) , (diff * C * 2)) result Math.min((diff * B) , (diff * C * 2)) Math.min Math (diff * B) diff B (diff * C * 2) diff * C * 2 diff C 2 if((C * (MIN * 2)) > ((A * MIN) + (B * MIN))){
      result += (A * MIN) + (B * MIN);
      
    }else{
      result += C * (MIN * 2);
    } (C * (MIN * 2)) > ((A * MIN) + (B * MIN)) (C * (MIN * 2)) C (MIN * 2) MIN 2 ((A * MIN) + (B * MIN)) (A * MIN) A MIN (B * MIN) B MIN {
      result += (A * MIN) + (B * MIN);
      
    } result += (A * MIN) + (B * MIN) result (A * MIN) + (B * MIN) (A * MIN) A MIN (B * MIN) B MIN {
      result += C * (MIN * 2);
    } result += C * (MIN * 2) result C * (MIN * 2) C (MIN * 2) MIN 2 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
  public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    int X = sc.nextInt();  //Aの個数
    int Y = sc.nextInt();  //Bの個数
    int MAX = Math.max(X,Y);
    int MIN = Math.min(X,Y);
    int diff = MAX - MIN;
    int result = 0;

    if(MAX == X){
      result += Math.min((diff * A) , (diff * C * 2));
    
    }else{
      result += Math.min((diff * B) , (diff * C * 2));
    }
    
    if((C * (MIN * 2)) > ((A * MIN) + (B * MIN))){
      result += (A * MIN) + (B * MIN);
      
    }else{
      result += C * (MIN * 2);
    }
    
    System.out.println(result);
  }
} public class Main {
  public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    int X = sc.nextInt();  //Aの個数
    int Y = sc.nextInt();  //Bの個数
    int MAX = Math.max(X,Y);
    int MIN = Math.min(X,Y);
    int diff = MAX - MIN;
    int result = 0;

    if(MAX == X){
      result += Math.min((diff * A) , (diff * C * 2));
    
    }else{
      result += Math.min((diff * B) , (diff * C * 2));
    }
    
    if((C * (MIN * 2)) > ((A * MIN) + (B * MIN))){
      result += (A * MIN) + (B * MIN);
      
    }else{
      result += C * (MIN * 2);
    }
    
    System.out.println(result);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    int X = sc.nextInt();  //Aの個数
    int Y = sc.nextInt();  //Bの個数
    int MAX = Math.max(X,Y);
    int MIN = Math.min(X,Y);
    int diff = MAX - MIN;
    int result = 0;

    if(MAX == X){
      result += Math.min((diff * A) , (diff * C * 2));
    
    }else{
      result += Math.min((diff * B) , (diff * C * 2));
    }
    
    if((C * (MIN * 2)) > ((A * MIN) + (B * MIN))){
      result += (A * MIN) + (B * MIN);
      
    }else{
      result += C * (MIN * 2);
    }
    
    System.out.println(result);
  }
}
