<?php

$line = trim(fgets(STDIN));
$line = array_map(function($val){ return intval($val); }, preg_split("/\s/", $line));
$a = $line[0];
$b = $line[1];
$half = $line[2] * 2;
$x = $line[3];
$y = $line[4];
$needed = 0;
// Aが高い
if($a > $b){
    if($b >= $half){
        $needed = $half * max([$x, $y]);
    }
    elseif($a >= $half){
        $needed = $x * $half + (($y - $x) > 0 ? $b * ($y - $x) :0);
    }
    else{
        $needed = $a * $x + $b * $y;
    }
}
else{
    if($a >= $half){
        $needed = $half * max([$x, $y]);
    }
    elseif($b >= $half){
        $needed = $y * $half + (($x - $y) > 0 ? $a * ($x - $y) :0);
    }
    else{
        $needed = $a * $x + $b * $y;
    } 
}
echo $needed . PHP_EOL;