package main

import (
	"fmt"
)

func main() {
	var A,B,C,X,Y int
	fmt.Scan(&A,&B,&C,&X,&Y)
	
	bigger := Max(X,Y)
	
	min := 500000000
	for ab := 0; ab <= bigger * 2; ab += 2 {
      	a := Max((X - ab / 2),0)
      	b := Max((Y - ab / 2),0)
		sum := a * A + b * B + ab * C
      //fmt.Printf("a=%d,b=%d,ab=%d,min=%d\n", a, b, ab, sum)
		min = Min(sum,min)
	}
	fmt.Println(min)
}

func Max(num1,num2 int) int {
	if num1 > num2 {
		return num1
	}
	return num2
}

func Min(num1,num2 int) int {
	if num1 < num2 {
		return num1
	}
	return num2
}