import java.util.Scanner;
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();
    int X = sc.nextInt();
    int Y = sc.nextInt();
    
    int set_AB = 0;
    if(A+B>=C*2){
      set_AB = C*2;
    }else{
      set_AB = A+B;
    }
    int common = Math.min(X,Y);
    int max = Math.max(X,Y);
    
    int last_price = 0;
    if(X>=Y){
      last_price = A;
    }else{
      last_price = B;
    }
    
    int last = max-common;//残りの枚数、値段は枚数が多いほう
    int extra = 0;
    if(last_price>=C*2){
       extra = C*2*last;
      }else{
       extra = last_price*last;
      }
   
    int charge = set_AB*common+extra;
    System.out.println(charge);
  }
} import java.util.Scanner; Scanner java.util 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();
    int X = sc.nextInt();
    int Y = sc.nextInt();
    
    int set_AB = 0;
    if(A+B>=C*2){
      set_AB = C*2;
    }else{
      set_AB = A+B;
    }
    int common = Math.min(X,Y);
    int max = Math.max(X,Y);
    
    int last_price = 0;
    if(X>=Y){
      last_price = A;
    }else{
      last_price = B;
    }
    
    int last = max-common;//残りの枚数、値段は枚数が多いほう
    int extra = 0;
    if(last_price>=C*2){
       extra = C*2*last;
      }else{
       extra = last_price*last;
      }
   
    int charge = set_AB*common+extra;
    System.out.println(charge);
  }
} 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();
    int X = sc.nextInt();
    int Y = sc.nextInt();
    
    int set_AB = 0;
    if(A+B>=C*2){
      set_AB = C*2;
    }else{
      set_AB = A+B;
    }
    int common = Math.min(X,Y);
    int max = Math.max(X,Y);
    
    int last_price = 0;
    if(X>=Y){
      last_price = A;
    }else{
      last_price = B;
    }
    
    int last = max-common;//残りの枚数、値段は枚数が多いほう
    int extra = 0;
    if(last_price>=C*2){
       extra = C*2*last;
      }else{
       extra = last_price*last;
      }
   
    int charge = set_AB*common+extra;
    System.out.println(charge);
  } main {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    int X = sc.nextInt();
    int Y = sc.nextInt();
    
    int set_AB = 0;
    if(A+B>=C*2){
      set_AB = C*2;
    }else{
      set_AB = A+B;
    }
    int common = Math.min(X,Y);
    int max = Math.max(X,Y);
    
    int last_price = 0;
    if(X>=Y){
      last_price = A;
    }else{
      last_price = B;
    }
    
    int last = max-common;//残りの枚数、値段は枚数が多いほう
    int extra = 0;
    if(last_price>=C*2){
       extra = C*2*last;
      }else{
       extra = last_price*last;
      }
   
    int charge = set_AB*common+extra;
    System.out.println(charge);
  } 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(); C 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 set_AB = 0; set_AB 0 if(A+B>=C*2){
      set_AB = C*2;
    }else{
      set_AB = A+B;
    } A+B>=C*2 A+B A B C*2 C 2 {
      set_AB = C*2;
    } set_AB = C*2 set_AB C*2 C 2 {
      set_AB = A+B;
    } set_AB = A+B set_AB A+B A B int common = Math.min(X,Y); common Math.min(X,Y) Math.min Math X Y int max = Math.max(X,Y); max Math.max(X,Y) Math.max Math X Y int last_price = 0; last_price 0 if(X>=Y){
      last_price = A;
    }else{
      last_price = B;
    } X>=Y X Y {
      last_price = A;
    } last_price = A last_price A {
      last_price = B;
    } last_price = B last_price B int last = max-common; last max-common max common int extra = 0; extra 0 if(last_price>=C*2){
       extra = C*2*last;
      }else{
       extra = last_price*last;
      } last_price>=C*2 last_price C*2 C 2 {
       extra = C*2*last;
      } extra = C*2*last extra C*2*last C*2*last C 2 last {
       extra = last_price*last;
      } extra = last_price*last extra last_price*last last_price last int charge = set_AB*common+extra; charge set_AB*common+extra set_AB*common set_AB common extra System.out.println(charge) System.out.println System.out System System.out charge String[] args args
import java.util.Scanner;
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();
    int X = sc.nextInt();
    int Y = sc.nextInt();
    
    int set_AB = 0;
    if(A+B>=C*2){
      set_AB = C*2;
    }else{
      set_AB = A+B;
    }
    int common = Math.min(X,Y);
    int max = Math.max(X,Y);
    
    int last_price = 0;
    if(X>=Y){
      last_price = A;
    }else{
      last_price = B;
    }
    
    int last = max-common;//残りの枚数、値段は枚数が多いほう
    int extra = 0;
    if(last_price>=C*2){
       extra = C*2*last;
      }else{
       extra = last_price*last;
      }
   
    int charge = set_AB*common+extra;
    System.out.println(charge);
  }
}