import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int A = sc.nextInt(), B = sc.nextInt();
    int C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
    
    System.out.println(solve(A,B,C,X,Y));
  }

  private static long solve(int A, int B, int C, int X, int Y) {
    long ret = 1L<<60;
    for(int ab = 0; ab<=Math.max(X, Y)*2; ab++) {
      long temp = ab * C;
      // 買うべきA, Bの枚数
      int a = X-ab/2, b = Y-ab/2;
      if(a<0)a=0;
      if(b<0)b=0;
      temp += a*A + b*B;
      ret = Math.min(ret, temp);
    }
    return ret;
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int A = sc.nextInt(), B = sc.nextInt();
    int C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
    
    System.out.println(solve(A,B,C,X,Y));
  }

  private static long solve(int A, int B, int C, int X, int Y) {
    long ret = 1L<<60;
    for(int ab = 0; ab<=Math.max(X, Y)*2; ab++) {
      long temp = ab * C;
      // 買うべきA, Bの枚数
      int a = X-ab/2, b = Y-ab/2;
      if(a<0)a=0;
      if(b<0)b=0;
      temp += a*A + b*B;
      ret = Math.min(ret, temp);
    }
    return ret;
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int A = sc.nextInt(), B = sc.nextInt();
    int C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
    
    System.out.println(solve(A,B,C,X,Y));
  } main {
    Scanner sc = new Scanner(System.in);

    int A = sc.nextInt(), B = sc.nextInt();
    int C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
    
    System.out.println(solve(A,B,C,X,Y));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt() A sc.nextInt() sc.nextInt sc B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int 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 System.out.println(solve(A,B,C,X,Y)) System.out.println System.out System System.out solve(A,B,C,X,Y) solve A B C X Y String[] args args private static long solve(int A, int B, int C, int X, int Y) {
    long ret = 1L<<60;
    for(int ab = 0; ab<=Math.max(X, Y)*2; ab++) {
      long temp = ab * C;
      // 買うべきA, Bの枚数
      int a = X-ab/2, b = Y-ab/2;
      if(a<0)a=0;
      if(b<0)b=0;
      temp += a*A + b*B;
      ret = Math.min(ret, temp);
    }
    return ret;
  } solve {
    long ret = 1L<<60;
    for(int ab = 0; ab<=Math.max(X, Y)*2; ab++) {
      long temp = ab * C;
      // 買うべきA, Bの枚数
      int a = X-ab/2, b = Y-ab/2;
      if(a<0)a=0;
      if(b<0)b=0;
      temp += a*A + b*B;
      ret = Math.min(ret, temp);
    }
    return ret;
  } long ret = 1L<<60; ret 1L<<60 1L 60 for(int ab = 0; ab<=Math.max(X, Y)*2; ab++) {
      long temp = ab * C;
      // 買うべきA, Bの枚数
      int a = X-ab/2, b = Y-ab/2;
      if(a<0)a=0;
      if(b<0)b=0;
      temp += a*A + b*B;
      ret = Math.min(ret, temp);
    } int ab = 0; int ab = 0; ab 0 ab<=Math.max(X, Y)*2 ab Math.max(X, Y)*2 Math.max(X, Y) Math.max Math X Y 2 ab++ ab++ ab {
      long temp = ab * C;
      // 買うべきA, Bの枚数
      int a = X-ab/2, b = Y-ab/2;
      if(a<0)a=0;
      if(b<0)b=0;
      temp += a*A + b*B;
      ret = Math.min(ret, temp);
    } {
      long temp = ab * C;
      // 買うべきA, Bの枚数
      int a = X-ab/2, b = Y-ab/2;
      if(a<0)a=0;
      if(b<0)b=0;
      temp += a*A + b*B;
      ret = Math.min(ret, temp);
    } long temp = ab * C; temp ab * C ab C int a = X-ab/2 a X-ab/2 X ab/2 ab 2 b = Y-ab/2; b Y-ab/2 Y ab/2 ab 2 if(a<0)a=0; a<0 a 0 a=0 a 0 if(b<0)b=0; b<0 b 0 b=0 b 0 temp += a*A + b*B temp a*A + b*B a*A a A b*B b B ret = Math.min(ret, temp) ret Math.min(ret, temp) Math.min Math ret temp return ret; ret int A A int B B int C C int X X int Y Y public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int A = sc.nextInt(), B = sc.nextInt();
    int C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
    
    System.out.println(solve(A,B,C,X,Y));
  }

  private static long solve(int A, int B, int C, int X, int Y) {
    long ret = 1L<<60;
    for(int ab = 0; ab<=Math.max(X, Y)*2; ab++) {
      long temp = ab * C;
      // 買うべきA, Bの枚数
      int a = X-ab/2, b = Y-ab/2;
      if(a<0)a=0;
      if(b<0)b=0;
      temp += a*A + b*B;
      ret = Math.min(ret, temp);
    }
    return ret;
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int A = sc.nextInt(), B = sc.nextInt();
    int C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
    
    System.out.println(solve(A,B,C,X,Y));
  }

  private static long solve(int A, int B, int C, int X, int Y) {
    long ret = 1L<<60;
    for(int ab = 0; ab<=Math.max(X, Y)*2; ab++) {
      long temp = ab * C;
      // 買うべきA, Bの枚数
      int a = X-ab/2, b = Y-ab/2;
      if(a<0)a=0;
      if(b<0)b=0;
      temp += a*A + b*B;
      ret = Math.min(ret, temp);
    }
    return ret;
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int A = sc.nextInt(), B = sc.nextInt();
    int C = sc.nextInt(), X = sc.nextInt(), Y = sc.nextInt();
    
    System.out.println(solve(A,B,C,X,Y));
  }

  private static long solve(int A, int B, int C, int X, int Y) {
    long ret = 1L<<60;
    for(int ab = 0; ab<=Math.max(X, Y)*2; ab++) {
      long temp = ab * C;
      // 買うべきA, Bの枚数
      int a = X-ab/2, b = Y-ab/2;
      if(a<0)a=0;
      if(b<0)b=0;
      temp += a*A + b*B;
      ret = Math.min(ret, temp);
    }
    return ret;
  }
}
