using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		int A = int.Parse(str[0]);
		int B = int.Parse(str[1]);
		int C = int.Parse(str[2]);
		int X = int.Parse(str[3]);
		int Y = int.Parse(str[4]);
		int ans = 0;
		int ac = X;
		int bc = Y;
		int cc = 0;
		int min = 999999999;
		while(true){
			int n = ac*A+bc*B+cc*C;
			min = Math.Min(n,min);
			if(ac == 0 && bc == 0){
				break;
			} else {
				cc += 1;
				ac = Math.Max(0, X - cc / 2);
				bc = Math.Max(0, Y - cc / 2);
			}
		}
		Console.WriteLine(min);
	}
}