package main

import (
	"io"
	"os"

	"fmt"
)

func Solve(in io.Reader, out io.Writer) {
	var a, b, c, x, y int
	fmt.Fscan(in, &a, &b, &c, &x, &y)

	if (a+b)/2-c <= 0 {
		fmt.Fprintln(out, a*x+b*y)
		return
	}

	if x > y {
		fmt.Fprintln(out, (x-y)*min(a, c*2)+y*c*2)
		return
	}

	fmt.Fprintln(out, (y-x)*min(b, c*2)+x*c*2)
}

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

func main() {
	Solve(os.Stdin, os.Stdout)
}
