using System;
using System.Linq;

namespace Atcoder.ABC095
{
    public class C : IAtcoder
    {
        public void Run()
        {
            var r = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var A = r[0];
            var B = r[1];
            var C = r[2];
            var X = r[3];
            var Y = r[4];
            int p1 = 0;
            int p2 = 0;
            int p3 = 0;

            p1 = Math.Max(A, B) * 2 * C;
            p2 = A * X + B * Y;
            p3 = A < B ? A * X + (B - A) * 2 * C : B * Y + (A - B) * 2 * C;
            var ret = Math.Max(Math.Max(p1, p2), p3);
            Console.WriteLine(ret);

        }
    }
}