#include <iostream>

using namespace std;

inline double avg (double x, double y) {
    return (x+y)/2;
}

int main()
{
    int x, y, price_a, x_rem, y_rem, price_b, price_ab, final_cost = 0, add1, add2;
    cin >> price_a >> price_b >> price_ab >> x >> y;
    // Buy in AB till it makes sense
    // An AB pizza has the value of 1/2 A type and 1/2 B type;
    // That till one kind of them is exhausted
    // += min(x,y) * price_ab if price_ab < avg(price_a, price_b)
    // y_rem = {y - min(x,y)} is number of y type pizzas you still need
    // final_cost += min ( buy using B-type, Buy using AB-Type)
    // same repeated for x
    if (price_ab*2 < avg(price_a,price_b)) {
        final_cost += min(x,y)*price_ab;
        y = y - min(x,y);
        x = x - min(x,y);
    }

    add1 = y*min(price_b, price_ab*2);
    if (price_ab * 2 < price_b) {
        x_rem = x - y;
    } else {
        x_rem = x;
    }
    if ( x > 0) {
        add1 += x_rem * min(price_a,price_ab*2);
    }

    add2 = x*min(price_a, price_ab*2);
    if (price_ab * 2 < price_b) {
        y_rem = y - x;
    } else {
        y_rem = y
    }
    if ( x > 0) {
        add2 += y_rem * min(price_b,price_ab*2);
    }

    cout << final_cost + min (add1,add2);
    return 0;
}
