#include<stdio.h>

int max(int a,int b){
  if(a>b){
    return a;
  }
  else
    return b;
}

int main(){
  int i,j,k;
  int A,B,AB,nA,nB;
  scanf("%d %d %d %d %d",&A,&B,&AB,&nA,&nB);
  long ans=1000000000000000;
  long tmp;
  
  for(i=0;i<=100000;i++){
    tmp= i*2C + max(nA-i,0)*A + max(nB-i,0)*B;
    if(tmp < ans)
      ans = tmp;
  }
  
  printf("%ld\n",ans);
  return 0;
}
    