import java.util.*;

class Main {
  public static final int MOD = 1000000007;
  public static final int INF = 1000000000;
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A,B,C,X,Y;
    A = sc.nextInt();
    B = sc.nextInt();
    C = sc.nextInt();
    X = sc.nextInt();
    Y = sc.nextInt();
    int pizaC = 2 * Math.max(X,Y);
    int pizaA, pizaB;
    int ans = INF;
    int tmp;
    while(pizaC >= 0){
      pizaA = Math.max(0, X - pizaC/2);
      pizaB = Math.max(0, Y - pizaC/2);
      tmp = pizaA * A + pizaB * B + pizaC * C;
      ans = Math.min(tmp, ans);
      pizaC--;
    }
    System.out.println(ans);
  }

  public static int gcd(int a, int b){
    if(b == 0) return a;
    return gcd(b, a%b);
  }
} import java.util.*; util.* java class Main {
  public static final int MOD = 1000000007;
  public static final int INF = 1000000000;
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A,B,C,X,Y;
    A = sc.nextInt();
    B = sc.nextInt();
    C = sc.nextInt();
    X = sc.nextInt();
    Y = sc.nextInt();
    int pizaC = 2 * Math.max(X,Y);
    int pizaA, pizaB;
    int ans = INF;
    int tmp;
    while(pizaC >= 0){
      pizaA = Math.max(0, X - pizaC/2);
      pizaB = Math.max(0, Y - pizaC/2);
      tmp = pizaA * A + pizaB * B + pizaC * C;
      ans = Math.min(tmp, ans);
      pizaC--;
    }
    System.out.println(ans);
  }

  public static int gcd(int a, int b){
    if(b == 0) return a;
    return gcd(b, a%b);
  }
} Main public static final int MOD = 1000000007; MOD 1000000007 public static final int INF = 1000000000; INF 1000000000 public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A,B,C,X,Y;
    A = sc.nextInt();
    B = sc.nextInt();
    C = sc.nextInt();
    X = sc.nextInt();
    Y = sc.nextInt();
    int pizaC = 2 * Math.max(X,Y);
    int pizaA, pizaB;
    int ans = INF;
    int tmp;
    while(pizaC >= 0){
      pizaA = Math.max(0, X - pizaC/2);
      pizaB = Math.max(0, Y - pizaC/2);
      tmp = pizaA * A + pizaB * B + pizaC * C;
      ans = Math.min(tmp, ans);
      pizaC--;
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int A,B,C,X,Y;
    A = sc.nextInt();
    B = sc.nextInt();
    C = sc.nextInt();
    X = sc.nextInt();
    Y = sc.nextInt();
    int pizaC = 2 * Math.max(X,Y);
    int pizaA, pizaB;
    int ans = INF;
    int tmp;
    while(pizaC >= 0){
      pizaA = Math.max(0, X - pizaC/2);
      pizaB = Math.max(0, Y - pizaC/2);
      tmp = pizaA * A + pizaB * B + pizaC * C;
      ans = Math.min(tmp, ans);
      pizaC--;
    }
    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A A B B C C X X Y; Y A = sc.nextInt() A sc.nextInt() sc.nextInt sc B = sc.nextInt() B sc.nextInt() sc.nextInt sc C = sc.nextInt() C sc.nextInt() sc.nextInt sc X = sc.nextInt() X sc.nextInt() sc.nextInt sc Y = sc.nextInt() Y sc.nextInt() sc.nextInt sc int pizaC = 2 * Math.max(X,Y); pizaC 2 * Math.max(X,Y) 2 Math.max(X,Y) Math.max Math X Y int pizaA pizaA pizaB; pizaB int ans = INF; ans INF int tmp; tmp while(pizaC >= 0){
      pizaA = Math.max(0, X - pizaC/2);
      pizaB = Math.max(0, Y - pizaC/2);
      tmp = pizaA * A + pizaB * B + pizaC * C;
      ans = Math.min(tmp, ans);
      pizaC--;
    } pizaC >= 0 pizaC 0 {
      pizaA = Math.max(0, X - pizaC/2);
      pizaB = Math.max(0, Y - pizaC/2);
      tmp = pizaA * A + pizaB * B + pizaC * C;
      ans = Math.min(tmp, ans);
      pizaC--;
    } pizaA = Math.max(0, X - pizaC/2) pizaA Math.max(0, X - pizaC/2) Math.max Math 0 X - pizaC/2 X pizaC/2 pizaC 2 pizaB = Math.max(0, Y - pizaC/2) pizaB Math.max(0, Y - pizaC/2) Math.max Math 0 Y - pizaC/2 Y pizaC/2 pizaC 2 tmp = pizaA * A + pizaB * B + pizaC * C tmp pizaA * A + pizaB * B + pizaC * C pizaA * A + pizaB * B + pizaC * C pizaA * A pizaA A pizaB * B pizaB B pizaC * C pizaC C ans = Math.min(tmp, ans) ans Math.min(tmp, ans) Math.min Math tmp ans pizaC-- pizaC System.out.println(ans) System.out.println System.out System System.out ans String[] args args public static int gcd(int a, int b){
    if(b == 0) return a;
    return gcd(b, a%b);
  } gcd {
    if(b == 0) return a;
    return gcd(b, a%b);
  } if(b == 0) return a; b == 0 b 0 return a; a return gcd(b, a%b); gcd(b, a%b) gcd b a%b a b int a a int b b
import java.util.*;

class Main {
  public static final int MOD = 1000000007;
  public static final int INF = 1000000000;
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A,B,C,X,Y;
    A = sc.nextInt();
    B = sc.nextInt();
    C = sc.nextInt();
    X = sc.nextInt();
    Y = sc.nextInt();
    int pizaC = 2 * Math.max(X,Y);
    int pizaA, pizaB;
    int ans = INF;
    int tmp;
    while(pizaC >= 0){
      pizaA = Math.max(0, X - pizaC/2);
      pizaB = Math.max(0, Y - pizaC/2);
      tmp = pizaA * A + pizaB * B + pizaC * C;
      ans = Math.min(tmp, ans);
      pizaC--;
    }
    System.out.println(ans);
  }

  public static int gcd(int a, int b){
    if(b == 0) return a;
    return gcd(b, a%b);
  }
}