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 ab=sc.nextInt();int x=sc.nextInt();
    int y=sc.nextInt();
    int sum=0;
    if(a+b>ab*2){
        int po=Math.min(x,y);
        sum+=po*ab*2;
        x-=po;
        y-=po;
    }
    sum+=(a>ab*2)?x*ab*2:x*a;
    sum+=(b>ab*2)?y*ab*2:y*b;
    System.out.println(sum);
}

} 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 ab=sc.nextInt();int x=sc.nextInt();
    int y=sc.nextInt();
    int sum=0;
    if(a+b>ab*2){
        int po=Math.min(x,y);
        sum+=po*ab*2;
        x-=po;
        y-=po;
    }
    sum+=(a>ab*2)?x*ab*2:x*a;
    sum+=(b>ab*2)?y*ab*2:y*b;
    System.out.println(sum);
}

} Main public static void main(String[]args){
  Scanner sc=new Scanner(System.in);
  int a=sc.nextInt();
    int b=sc.nextInt();
    int ab=sc.nextInt();int x=sc.nextInt();
    int y=sc.nextInt();
    int sum=0;
    if(a+b>ab*2){
        int po=Math.min(x,y);
        sum+=po*ab*2;
        x-=po;
        y-=po;
    }
    sum+=(a>ab*2)?x*ab*2:x*a;
    sum+=(b>ab*2)?y*ab*2:y*b;
    System.out.println(sum);
} main {
  Scanner sc=new Scanner(System.in);
  int a=sc.nextInt();
    int b=sc.nextInt();
    int ab=sc.nextInt();int x=sc.nextInt();
    int y=sc.nextInt();
    int sum=0;
    if(a+b>ab*2){
        int po=Math.min(x,y);
        sum+=po*ab*2;
        x-=po;
        y-=po;
    }
    sum+=(a>ab*2)?x*ab*2:x*a;
    sum+=(b>ab*2)?y*ab*2:y*b;
    System.out.println(sum);
} 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 ab=sc.nextInt(); ab 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 sum=0; sum 0 if(a+b>ab*2){
        int po=Math.min(x,y);
        sum+=po*ab*2;
        x-=po;
        y-=po;
    } a+b>ab*2 a+b a b ab*2 ab 2 {
        int po=Math.min(x,y);
        sum+=po*ab*2;
        x-=po;
        y-=po;
    } int po=Math.min(x,y); po Math.min(x,y) Math.min Math x y sum+=po*ab*2 sum po*ab*2 po*ab*2 po ab 2 x-=po x po y-=po y po sum+=(a>ab*2)?x*ab*2:x*a sum (a>ab*2)?x*ab*2:x*a (a>ab*2) a ab*2 ab 2 x*ab*2 x*ab*2 x ab 2 x*a x a sum+=(b>ab*2)?y*ab*2:y*b sum (b>ab*2)?y*ab*2:y*b (b>ab*2) b ab*2 ab 2 y*ab*2 y*ab*2 y ab 2 y*b y b System.out.println(sum) System.out.println System.out System System.out sum 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 ab=sc.nextInt();int x=sc.nextInt();
    int y=sc.nextInt();
    int sum=0;
    if(a+b>ab*2){
        int po=Math.min(x,y);
        sum+=po*ab*2;
        x-=po;
        y-=po;
    }
    sum+=(a>ab*2)?x*ab*2:x*a;
    sum+=(b>ab*2)?y*ab*2:y*b;
    System.out.println(sum);
}

} public class Main{
public static void main(String[]args){
  Scanner sc=new Scanner(System.in);
  int a=sc.nextInt();
    int b=sc.nextInt();
    int ab=sc.nextInt();int x=sc.nextInt();
    int y=sc.nextInt();
    int sum=0;
    if(a+b>ab*2){
        int po=Math.min(x,y);
        sum+=po*ab*2;
        x-=po;
        y-=po;
    }
    sum+=(a>ab*2)?x*ab*2:x*a;
    sum+=(b>ab*2)?y*ab*2:y*b;
    System.out.println(sum);
}

} 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 ab=sc.nextInt();int x=sc.nextInt();
    int y=sc.nextInt();
    int sum=0;
    if(a+b>ab*2){
        int po=Math.min(x,y);
        sum+=po*ab*2;
        x-=po;
        y-=po;
    }
    sum+=(a>ab*2)?x*ab*2:x*a;
    sum+=(b>ab*2)?y*ab*2:y*b;
    System.out.println(sum);
}

}
