import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int c = Integer.parseInt(str[2]);
    int x = Integer.parseInt(str[3]);
    int y = Integer.parseInt(str[4]);
    int sum = 0;
    int ans = a*x+b*y;
    
    for(int i=0; i<=2*Math.max(x,y)+2; i+=2){
      sum = Math.max(0,(x-i/2))*a+Math.max(0,(y-i/2))*b+i*c;
      ans = Math.min(ans,sum);
    }
    
    System.out.println(ans);
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int c = Integer.parseInt(str[2]);
    int x = Integer.parseInt(str[3]);
    int y = Integer.parseInt(str[4]);
    int sum = 0;
    int ans = a*x+b*y;
    
    for(int i=0; i<=2*Math.max(x,y)+2; i+=2){
      sum = Math.max(0,(x-i/2))*a+Math.max(0,(y-i/2))*b+i*c;
      ans = Math.min(ans,sum);
    }
    
    System.out.println(ans);
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int c = Integer.parseInt(str[2]);
    int x = Integer.parseInt(str[3]);
    int y = Integer.parseInt(str[4]);
    int sum = 0;
    int ans = a*x+b*y;
    
    for(int i=0; i<=2*Math.max(x,y)+2; i+=2){
      sum = Math.max(0,(x-i/2))*a+Math.max(0,(y-i/2))*b+i*c;
      ans = Math.min(ans,sum);
    }
    
    System.out.println(ans);
  } main {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int c = Integer.parseInt(str[2]);
    int x = Integer.parseInt(str[3]);
    int y = Integer.parseInt(str[4]);
    int sum = 0;
    int ans = a*x+b*y;
    
    for(int i=0; i<=2*Math.max(x,y)+2; i+=2){
      sum = Math.max(0,(x-i/2))*a+Math.max(0,(y-i/2))*b+i*c;
      ans = Math.min(ans,sum);
    }
    
    System.out.println(ans);
  } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String[] str = in.readLine().split(" "); str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int a = Integer.parseInt(str[0]); a Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int b = Integer.parseInt(str[1]); b Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int c = Integer.parseInt(str[2]); c Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 int x = Integer.parseInt(str[3]); x Integer.parseInt(str[3]) Integer.parseInt Integer str[3] str 3 int y = Integer.parseInt(str[4]); y Integer.parseInt(str[4]) Integer.parseInt Integer str[4] str 4 int sum = 0; sum 0 int ans = a*x+b*y; ans a*x+b*y a*x a x b*y b y for(int i=0; i<=2*Math.max(x,y)+2; i+=2){
      sum = Math.max(0,(x-i/2))*a+Math.max(0,(y-i/2))*b+i*c;
      ans = Math.min(ans,sum);
    } int i=0; int i=0; i 0 i<=2*Math.max(x,y)+2 i 2*Math.max(x,y)+2 2*Math.max(x,y) 2 Math.max(x,y) Math.max Math x y 2 i+=2 i+=2 i 2 {
      sum = Math.max(0,(x-i/2))*a+Math.max(0,(y-i/2))*b+i*c;
      ans = Math.min(ans,sum);
    } {
      sum = Math.max(0,(x-i/2))*a+Math.max(0,(y-i/2))*b+i*c;
      ans = Math.min(ans,sum);
    } sum = Math.max(0,(x-i/2))*a+Math.max(0,(y-i/2))*b+i*c sum Math.max(0,(x-i/2))*a+Math.max(0,(y-i/2))*b+i*c Math.max(0,(x-i/2))*a+Math.max(0,(y-i/2))*b+i*c Math.max(0,(x-i/2))*a Math.max(0,(x-i/2)) Math.max Math 0 (x-i/2) x i/2 i 2 a Math.max(0,(y-i/2))*b Math.max(0,(y-i/2)) Math.max Math 0 (y-i/2) y i/2 i 2 b i*c i c ans = Math.min(ans,sum) ans Math.min(ans,sum) Math.min Math ans sum System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int c = Integer.parseInt(str[2]);
    int x = Integer.parseInt(str[3]);
    int y = Integer.parseInt(str[4]);
    int sum = 0;
    int ans = a*x+b*y;
    
    for(int i=0; i<=2*Math.max(x,y)+2; i+=2){
      sum = Math.max(0,(x-i/2))*a+Math.max(0,(y-i/2))*b+i*c;
      ans = Math.min(ans,sum);
    }
    
    System.out.println(ans);
  }
} public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int c = Integer.parseInt(str[2]);
    int x = Integer.parseInt(str[3]);
    int y = Integer.parseInt(str[4]);
    int sum = 0;
    int ans = a*x+b*y;
    
    for(int i=0; i<=2*Math.max(x,y)+2; i+=2){
      sum = Math.max(0,(x-i/2))*a+Math.max(0,(y-i/2))*b+i*c;
      ans = Math.min(ans,sum);
    }
    
    System.out.println(ans);
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int c = Integer.parseInt(str[2]);
    int x = Integer.parseInt(str[3]);
    int y = Integer.parseInt(str[4]);
    int sum = 0;
    int ans = a*x+b*y;
    
    for(int i=0; i<=2*Math.max(x,y)+2; i+=2){
      sum = Math.max(0,(x-i/2))*a+Math.max(0,(y-i/2))*b+i*c;
      ans = Math.min(ans,sum);
    }
    
    System.out.println(ans);
  }
}