import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int pizaA = sc.nextInt();
    int pizaB = sc.nextInt();
    int pizaAB = sc.nextInt();
    int pieceOfA = sc.nextInt();
    int pieceOfB = sc.nextInt();
    if (pizaA + pizaB <= 2 * pizaAB) {
      System.out.println(pizaA * pieceOfA + pizaB * pieceOfB);
    } else {
      if (pieceOfA > pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfB + 
                                                  (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB));
      } else if (pieceOfA == pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfA);
      } else {
        System.out.println(2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB));
      }
      
      
      
    }
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int pizaA = sc.nextInt();
    int pizaB = sc.nextInt();
    int pizaAB = sc.nextInt();
    int pieceOfA = sc.nextInt();
    int pieceOfB = sc.nextInt();
    if (pizaA + pizaB <= 2 * pizaAB) {
      System.out.println(pizaA * pieceOfA + pizaB * pieceOfB);
    } else {
      if (pieceOfA > pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfB + 
                                                  (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB));
      } else if (pieceOfA == pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfA);
      } else {
        System.out.println(2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB));
      }
      
      
      
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int pizaA = sc.nextInt();
    int pizaB = sc.nextInt();
    int pizaAB = sc.nextInt();
    int pieceOfA = sc.nextInt();
    int pieceOfB = sc.nextInt();
    if (pizaA + pizaB <= 2 * pizaAB) {
      System.out.println(pizaA * pieceOfA + pizaB * pieceOfB);
    } else {
      if (pieceOfA > pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfB + 
                                                  (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB));
      } else if (pieceOfA == pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfA);
      } else {
        System.out.println(2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB));
      }
      
      
      
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int pizaA = sc.nextInt();
    int pizaB = sc.nextInt();
    int pizaAB = sc.nextInt();
    int pieceOfA = sc.nextInt();
    int pieceOfB = sc.nextInt();
    if (pizaA + pizaB <= 2 * pizaAB) {
      System.out.println(pizaA * pieceOfA + pizaB * pieceOfB);
    } else {
      if (pieceOfA > pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfB + 
                                                  (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB));
      } else if (pieceOfA == pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfA);
      } else {
        System.out.println(2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB));
      }
      
      
      
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int pizaA = sc.nextInt(); pizaA sc.nextInt() sc.nextInt sc int pizaB = sc.nextInt(); pizaB sc.nextInt() sc.nextInt sc int pizaAB = sc.nextInt(); pizaAB sc.nextInt() sc.nextInt sc int pieceOfA = sc.nextInt(); pieceOfA sc.nextInt() sc.nextInt sc int pieceOfB = sc.nextInt(); pieceOfB sc.nextInt() sc.nextInt sc if (pizaA + pizaB <= 2 * pizaAB) {
      System.out.println(pizaA * pieceOfA + pizaB * pieceOfB);
    } else {
      if (pieceOfA > pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfB + 
                                                  (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB));
      } else if (pieceOfA == pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfA);
      } else {
        System.out.println(2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB));
      }
      
      
      
    } pizaA + pizaB <= 2 * pizaAB pizaA + pizaB pizaA pizaB 2 * pizaAB 2 pizaAB {
      System.out.println(pizaA * pieceOfA + pizaB * pieceOfB);
    } System.out.println(pizaA * pieceOfA + pizaB * pieceOfB) System.out.println System.out System System.out pizaA * pieceOfA + pizaB * pieceOfB pizaA * pieceOfA pizaA pieceOfA pizaB * pieceOfB pizaB pieceOfB {
      if (pieceOfA > pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfB + 
                                                  (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB));
      } else if (pieceOfA == pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfA);
      } else {
        System.out.println(2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB));
      }
      
      
      
    } if (pieceOfA > pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfB + 
                                                  (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB));
      } else if (pieceOfA == pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfA);
      } else {
        System.out.println(2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB));
      } pieceOfA > pieceOfB pieceOfA pieceOfB {
        System.out.println(2 * pizaAB * pieceOfB + 
                                                  (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB));
      } System.out.println(2 * pizaAB * pieceOfB + 
                                                  (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB)) System.out.println System.out System System.out 2 * pizaAB * pieceOfB + 
                                                  (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB) 2 * pizaAB * pieceOfB 2 * pizaAB * pieceOfB 2 pizaAB pieceOfB (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB) (pieceOfA - pieceOfB) pieceOfA pieceOfB Math.min(pizaA, 2 * pizaAB) Math.min Math pizaA 2 * pizaAB 2 pizaAB if (pieceOfA == pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfA);
      } else {
        System.out.println(2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB));
      } pieceOfA == pieceOfB pieceOfA pieceOfB {
        System.out.println(2 * pizaAB * pieceOfA);
      } System.out.println(2 * pizaAB * pieceOfA) System.out.println System.out System System.out 2 * pizaAB * pieceOfA 2 * pizaAB * pieceOfA 2 pizaAB pieceOfA {
        System.out.println(2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB));
      } System.out.println(2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB)) System.out.println System.out System System.out 2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB) 2 * pizaAB * pieceOfA 2 * pizaAB * pieceOfA 2 pizaAB pieceOfA (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB) (pieceOfB - pieceOfA) pieceOfB pieceOfA Math.min(pizaB, 2 * pizaAB) Math.min Math pizaB 2 * pizaAB 2 pizaAB String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int pizaA = sc.nextInt();
    int pizaB = sc.nextInt();
    int pizaAB = sc.nextInt();
    int pieceOfA = sc.nextInt();
    int pieceOfB = sc.nextInt();
    if (pizaA + pizaB <= 2 * pizaAB) {
      System.out.println(pizaA * pieceOfA + pizaB * pieceOfB);
    } else {
      if (pieceOfA > pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfB + 
                                                  (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB));
      } else if (pieceOfA == pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfA);
      } else {
        System.out.println(2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB));
      }
      
      
      
    }
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int pizaA = sc.nextInt();
    int pizaB = sc.nextInt();
    int pizaAB = sc.nextInt();
    int pieceOfA = sc.nextInt();
    int pieceOfB = sc.nextInt();
    if (pizaA + pizaB <= 2 * pizaAB) {
      System.out.println(pizaA * pieceOfA + pizaB * pieceOfB);
    } else {
      if (pieceOfA > pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfB + 
                                                  (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB));
      } else if (pieceOfA == pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfA);
      } else {
        System.out.println(2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB));
      }
      
      
      
    }
  }
} Main
import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int pizaA = sc.nextInt();
    int pizaB = sc.nextInt();
    int pizaAB = sc.nextInt();
    int pieceOfA = sc.nextInt();
    int pieceOfB = sc.nextInt();
    if (pizaA + pizaB <= 2 * pizaAB) {
      System.out.println(pizaA * pieceOfA + pizaB * pieceOfB);
    } else {
      if (pieceOfA > pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfB + 
                                                  (pieceOfA - pieceOfB) * Math.min(pizaA, 2 * pizaAB));
      } else if (pieceOfA == pieceOfB) {
        System.out.println(2 * pizaAB * pieceOfA);
      } else {
        System.out.println(2 * pizaAB * pieceOfA +
                                                 (pieceOfB - pieceOfA) * Math.min(pizaB, 2 * pizaAB));
      }
      
      
      
    }
  }
}