import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

int calc(int a, int b, int c, int x, int y) {
    int minCost = int.max;
    // AB ピザを 2*i 個かう
    for (int i = 0; i <= max(x, y); i++) {
        int cost = 2 * c * i + max(x - i, 0) * a + max(y - i, 0) * b;
        minCost = min(minCost, cost);
    }
    return minCost;
}

void main() {
   auto xs = readints;
   int a = xs[0], b = xs[1], c = xs[2], x = xs[3], y = xs[4];

   auto ans = calc(a, b, c, x, y);
   writeln(ans);
}
