package main

import "fmt"

func min(a int, b int) int {
	if a > b {
		return b
	}
	return a
}

func main() {
	var a, b, c, x, y int
	fmt.Scan(&a, &b, &c, &x, &y)

	result := 0
	maxC := min(x, y) * 2
	for i := 0; i <= maxC; i++ {
		if i == 0 {
			result = a*(x-i/2) + b*(y-i/2) + c*i
		} else {
			if i%2 == 0 {
				tmp := a*(x-i/2) + b*(y-i/2) + c*i
				result = min(tmp, result)
			}
		}
	}
	fmt.Println(result)
}
