package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {

	// input
	params := inputLineAsNumArray(5)
	pA := params[0]
	pB := params[1]
	pAB := params[2]
	rA := params[3]
	rB := params[4]

	//created
	cA := 0
	cB := 0

	sum := 0
	if pAB < (pA+pB)/2 {
		min := min(rA, rB)
		sum += min * 2 * pAB
		cA += min
		cB += min
	}

	if 2*pAB < pA {
		toCreate := (rA - cA)
		sum += toCreate * 2 * pAB
		cA += toCreate
		cB += toCreate
	}

	if 2*pAB < pB {
		toCreate := (rB - cB)
		sum += toCreate * 2 * pAB
		cA += toCreate
		cB += toCreate
	}

	toCreate := (rA - cA)
	sum += toCreate * pA

	toCreate = (rB - cB)
	sum += toCreate * pB

	fmt.Println(sum)
}

func min(x, y int) int {
	if x <= y {
		return x
	} else {
		return y
	}
}

func max(x, y int) int {
	if x >= y {
		return x
	} else {
		return y
	}
}

func inputLineAsNumArray(length int) []int {

	line := strings.Split(readLine(), " ")
	var nums []int
	for i := 0; i < length; i++ {
		num, _ := strconv.Atoi(line[i])
		nums = append(nums, num)
	}
	return nums
}

func readLine() string {

	sc.Scan()
	return sc.Text()
}
