import 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 c = sc.nextInt() * 2;
    int x = sc.nextInt();
    int y = sc.nextInt();
    int total = a * x + b * y;
    while(x>0&&y>0){
      total = Math.min(total,total -a -b +c);
      x--;
      y--;
    }
    while(x>0){
      total = Math.min(total,total -a +c);
      x--;
    }
    while(y>0){
      total = Math.min(total,total -b +c);
      y--;
    }
    System.out.println(total);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt() * 2;
    int x = sc.nextInt();
    int y = sc.nextInt();
    int total = a * x + b * y;
    while(x>0&&y>0){
      total = Math.min(total,total -a -b +c);
      x--;
      y--;
    }
    while(x>0){
      total = Math.min(total,total -a +c);
      x--;
    }
    while(y>0){
      total = Math.min(total,total -b +c);
      y--;
    }
    System.out.println(total);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt() * 2;
    int x = sc.nextInt();
    int y = sc.nextInt();
    int total = a * x + b * y;
    while(x>0&&y>0){
      total = Math.min(total,total -a -b +c);
      x--;
      y--;
    }
    while(x>0){
      total = Math.min(total,total -a +c);
      x--;
    }
    while(y>0){
      total = Math.min(total,total -b +c);
      y--;
    }
    System.out.println(total);
  } main {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt() * 2;
    int x = sc.nextInt();
    int y = sc.nextInt();
    int total = a * x + b * y;
    while(x>0&&y>0){
      total = Math.min(total,total -a -b +c);
      x--;
      y--;
    }
    while(x>0){
      total = Math.min(total,total -a +c);
      x--;
    }
    while(y>0){
      total = Math.min(total,total -b +c);
      y--;
    }
    System.out.println(total);
  } 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 c = sc.nextInt() * 2; c sc.nextInt() * 2 sc.nextInt() sc.nextInt sc 2 int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int y = sc.nextInt(); y sc.nextInt() sc.nextInt sc int total = a * x + b * y; total a * x + b * y a * x a x b * y b y while(x>0&&y>0){
      total = Math.min(total,total -a -b +c);
      x--;
      y--;
    } x>0&&y>0 x>0 x 0 y>0 y 0 {
      total = Math.min(total,total -a -b +c);
      x--;
      y--;
    } total = Math.min(total,total -a -b +c) total Math.min(total,total -a -b +c) Math.min Math total total -a -b +c total -a -b total -a -b total a b c x-- x y-- y while(x>0){
      total = Math.min(total,total -a +c);
      x--;
    } x>0 x 0 {
      total = Math.min(total,total -a +c);
      x--;
    } total = Math.min(total,total -a +c) total Math.min(total,total -a +c) Math.min Math total total -a +c total -a total a c x-- x while(y>0){
      total = Math.min(total,total -b +c);
      y--;
    } y>0 y 0 {
      total = Math.min(total,total -b +c);
      y--;
    } total = Math.min(total,total -b +c) total Math.min(total,total -b +c) Math.min Math total total -b +c total -b total b c y-- y System.out.println(total) System.out.println System.out System System.out total 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 c = sc.nextInt() * 2;
    int x = sc.nextInt();
    int y = sc.nextInt();
    int total = a * x + b * y;
    while(x>0&&y>0){
      total = Math.min(total,total -a -b +c);
      x--;
      y--;
    }
    while(x>0){
      total = Math.min(total,total -a +c);
      x--;
    }
    while(y>0){
      total = Math.min(total,total -b +c);
      y--;
    }
    System.out.println(total);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt() * 2;
    int x = sc.nextInt();
    int y = sc.nextInt();
    int total = a * x + b * y;
    while(x>0&&y>0){
      total = Math.min(total,total -a -b +c);
      x--;
      y--;
    }
    while(x>0){
      total = Math.min(total,total -a +c);
      x--;
    }
    while(y>0){
      total = Math.min(total,total -b +c);
      y--;
    }
    System.out.println(total);
  }
} Main
import 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 c = sc.nextInt() * 2;
    int x = sc.nextInt();
    int y = sc.nextInt();
    int total = a * x + b * y;
    while(x>0&&y>0){
      total = Math.min(total,total -a -b +c);
      x--;
      y--;
    }
    while(x>0){
      total = Math.min(total,total -a +c);
      x--;
    }
    while(y>0){
      total = Math.min(total,total -b +c);
      y--;
    }
    System.out.println(total);
  }
}
