#include <iostream>
using namespace std;
long long a, b, c, x, y, count = 1000000000000;
int main(){
    cin >> a >> b >> c >> x >> y;

    for(int i=0;i<=x;i++){
        for(int j=0;j<=y;j++){
            count = min(count, a*i+b*j+2*c*max(x-i, y-j));
        }
    }
    cout << count << endl;
    return 0;
}