using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace C
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var abcxy = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            var a = abcxy[0];
            var b = abcxy[1];
            var c = abcxy[2];
            var x = abcxy[3];
            var y = abcxy[4];
            var answer = 0L;
            var useC = (a + b) > 2 * c;
            if (useC)
            {
                if (2 * c <= a && 2 * c <= b) answer += 2 * c * Math.Max(x, y);
                else
                {
                    var min = Math.Min(x, y);
                    answer = 2 * c * min + a * (x - min) + b * (y - min);
                }
            }
            else
            {
                answer = a * x + b * y;
            }


            Console.WriteLine(answer);
        }
    }
}
