import java.util.*;
import java.util.ArrayList;
import java.util.List;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int ab = sc.nextInt();
    
    int x = sc.nextInt();
    int y = sc.nextInt();
    
    int min = (x < y ? x : y);
    int sub = Math.abs(x - y);
    
    int buyA = 0;
    int buyB = 0;
    int buyAB = 0;
    
    
    if(a + b > ab * 2){
      buyAB += min * 2;
      x -= min;
      y -= min;
    }
    
    if(a > ab * 2){
      buyAB += x * 2;
    }else{
      buyA += x;
    }
    
    if(b > ab * 2){
      buyAB += y * 2;
    }else{
      buyB += y;
    }
    
    System.out.println(buyA * a + buyB * b + buyAB * ab);
  }
} import java.util.*; util.* java import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int ab = sc.nextInt();
    
    int x = sc.nextInt();
    int y = sc.nextInt();
    
    int min = (x < y ? x : y);
    int sub = Math.abs(x - y);
    
    int buyA = 0;
    int buyB = 0;
    int buyAB = 0;
    
    
    if(a + b > ab * 2){
      buyAB += min * 2;
      x -= min;
      y -= min;
    }
    
    if(a > ab * 2){
      buyAB += x * 2;
    }else{
      buyA += x;
    }
    
    if(b > ab * 2){
      buyAB += y * 2;
    }else{
      buyB += y;
    }
    
    System.out.println(buyA * a + buyB * b + buyAB * ab);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int ab = sc.nextInt();
    
    int x = sc.nextInt();
    int y = sc.nextInt();
    
    int min = (x < y ? x : y);
    int sub = Math.abs(x - y);
    
    int buyA = 0;
    int buyB = 0;
    int buyAB = 0;
    
    
    if(a + b > ab * 2){
      buyAB += min * 2;
      x -= min;
      y -= min;
    }
    
    if(a > ab * 2){
      buyAB += x * 2;
    }else{
      buyA += x;
    }
    
    if(b > ab * 2){
      buyAB += y * 2;
    }else{
      buyB += y;
    }
    
    System.out.println(buyA * a + buyB * b + buyAB * ab);
  } main {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int ab = sc.nextInt();
    
    int x = sc.nextInt();
    int y = sc.nextInt();
    
    int min = (x < y ? x : y);
    int sub = Math.abs(x - y);
    
    int buyA = 0;
    int buyB = 0;
    int buyAB = 0;
    
    
    if(a + b > ab * 2){
      buyAB += min * 2;
      x -= min;
      y -= min;
    }
    
    if(a > ab * 2){
      buyAB += x * 2;
    }else{
      buyA += x;
    }
    
    if(b > ab * 2){
      buyAB += y * 2;
    }else{
      buyB += y;
    }
    
    System.out.println(buyA * a + buyB * b + buyAB * ab);
  } 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 ab = sc.nextInt(); ab 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 min = (x < y ? x : y); min (x < y ? x : y) x < y x y x y int sub = Math.abs(x - y); sub Math.abs(x - y) Math.abs Math x - y x y int buyA = 0; buyA 0 int buyB = 0; buyB 0 int buyAB = 0; buyAB 0 if(a + b > ab * 2){
      buyAB += min * 2;
      x -= min;
      y -= min;
    } a + b > ab * 2 a + b a b ab * 2 ab 2 {
      buyAB += min * 2;
      x -= min;
      y -= min;
    } buyAB += min * 2 buyAB min * 2 min 2 x -= min x min y -= min y min if(a > ab * 2){
      buyAB += x * 2;
    }else{
      buyA += x;
    } a > ab * 2 a ab * 2 ab 2 {
      buyAB += x * 2;
    } buyAB += x * 2 buyAB x * 2 x 2 {
      buyA += x;
    } buyA += x buyA x if(b > ab * 2){
      buyAB += y * 2;
    }else{
      buyB += y;
    } b > ab * 2 b ab * 2 ab 2 {
      buyAB += y * 2;
    } buyAB += y * 2 buyAB y * 2 y 2 {
      buyB += y;
    } buyB += y buyB y System.out.println(buyA * a + buyB * b + buyAB * ab) System.out.println System.out System System.out buyA * a + buyB * b + buyAB * ab buyA * a + buyB * b + buyAB * ab buyA * a buyA a buyB * b buyB b buyAB * ab buyAB ab String[] args args public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int ab = sc.nextInt();
    
    int x = sc.nextInt();
    int y = sc.nextInt();
    
    int min = (x < y ? x : y);
    int sub = Math.abs(x - y);
    
    int buyA = 0;
    int buyB = 0;
    int buyAB = 0;
    
    
    if(a + b > ab * 2){
      buyAB += min * 2;
      x -= min;
      y -= min;
    }
    
    if(a > ab * 2){
      buyAB += x * 2;
    }else{
      buyA += x;
    }
    
    if(b > ab * 2){
      buyAB += y * 2;
    }else{
      buyB += y;
    }
    
    System.out.println(buyA * a + buyB * b + buyAB * ab);
  }
} public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int ab = sc.nextInt();
    
    int x = sc.nextInt();
    int y = sc.nextInt();
    
    int min = (x < y ? x : y);
    int sub = Math.abs(x - y);
    
    int buyA = 0;
    int buyB = 0;
    int buyAB = 0;
    
    
    if(a + b > ab * 2){
      buyAB += min * 2;
      x -= min;
      y -= min;
    }
    
    if(a > ab * 2){
      buyAB += x * 2;
    }else{
      buyA += x;
    }
    
    if(b > ab * 2){
      buyAB += y * 2;
    }else{
      buyB += y;
    }
    
    System.out.println(buyA * a + buyB * b + buyAB * ab);
  }
} Main
import java.util.*;
import java.util.ArrayList;
import java.util.List;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int ab = sc.nextInt();
    
    int x = sc.nextInt();
    int y = sc.nextInt();
    
    int min = (x < y ? x : y);
    int sub = Math.abs(x - y);
    
    int buyA = 0;
    int buyB = 0;
    int buyAB = 0;
    
    
    if(a + b > ab * 2){
      buyAB += min * 2;
      x -= min;
      y -= min;
    }
    
    if(a > ab * 2){
      buyAB += x * 2;
    }else{
      buyA += x;
    }
    
    if(b > ab * 2){
      buyAB += y * 2;
    }else{
      buyB += y;
    }
    
    System.out.println(buyA * a + buyB * b + buyAB * ab);
  }
}