#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,x,y,ans=0;cin>>a>>b>>c>>x>>y;
  if(x<y){
    a^=c;c^=a;a^=c;
    x^=y;y^=x;x^=y;
  }
  while(y>0){
    ans+=(min(a+c,b+b));
    x--;y--;
  }
  while(x>0){
    ans+=min(a,b+b));
    x--;
  }
  cout<<ans<<endl;
}