use v5.10;
use List::Util qw/max min/;
use POSIX      qw/ceil/;

my ($a, $b, $c, $x, $y) = split(/[ \n]+/, <>);
#say join(",", $a, $b, $c, $x, $y); #debug

$naive  = $a * $x + $b * $y;
$all_ab = max($x, $y) * 2 * $c;
if ($x < $y) {
  $a_b_ab = $x * 2 * $c + ceil(($y - $x) / 2) * $b;
} else {
  $a_b_ab = $y * 2 * $c + ceil(($x - $y) / 2) * $a;
}

#say join("\n", $naive, $all_ab, $a_b_ab, "----"); #debug

say min($naive, $all_ab, $a_b_ab);
