#include <bits/stdc++.h>
using namespace std;


int main(){
    long long int a,b,c,x,y,z=0;
    long long int result;
    cin>>a>>b>>c>>x>>y;
    result=a*x+b*y;
    while(true){
        if(x==0||y==0) break;
        if(a+b<=C*2){
            x--;
            y--;
            z+=2;
            result=a*x+b*y+c*z;
        }
    }
    cout<<result>>endl;
    return 0;
}