<?php
// C
fscanf(STDIN, '%d %d %d %d %d', $a, $b, $c, $x, $y);
$ans = 0;
// A B 1枚ずつ用意
$num = min($x, $y);
$cost = min($a + $b, $c * 2);
$ans += $cost * $num;
// 残りのピザを用意
$num = $x > $num ? $x - $num : $y - $num;
$cost = $x > $n ? min($a, $c * 2) : min($b, $c * 2);
$ans += $cost * $num;
echo $ans;