import std.stdio, std.algorithm, std.range, std.conv, std.string, std.math;
import core.stdc.stdio;
// foreach, foreach_reverse, writeln

void main() {
	int a, b, c, x, y;
	scanf("%d%d%d%d%d", &a, &b, &c, &x, &y);
	a = min(a,c*2);
	b = min(b,c*2);
	int ans = a*x + b*y;
	ans -= max(0, a+b-c*2) * min(x,y);
	writeln(ans);
}