using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = System.Console.ReadLine().Split(' ');
            int A = int.Parse(input[0]), B = int.Parse(input[1]), AB = int.Parse(input[2]), _A = int.Parse(input[3]), _B = int.Parse(input[4]);
            int tmp_A = 0, tmp_B = 0;
            int min;
            if (_A % 2 == 1)
            {
                tmp_A++;
                _A--;
            }
            if (_B % 2 == 1)
            {
                tmp_B++;
                _B--;
            }
            if (_A < _B) min = _A;
            else min = _B;
            long ary = 0;
            if (A + B >= 2 * AB) ary += (2 * AB) * min;
            else ary += ( A  + B) * min ;
            if (_A > _B)
            {
                if (A < 2 * AB) ary += A * (_A - min);
                else ary += (2 * AB) * (_A - min);
            }
            else
            {
                if (B < 2 * AB) ary += B * (_B - min);
                else ary += (2 * AB) * (_B - min);
            }
            if (A < 2 * AB) ary += A * tmp_A;
            else ary += 2 * AB * tmp_A;
            if (B < 2 * AB) ary += B * tmp_B;
            else ary += 2 * AB * tmp_B;
            System.Console.WriteLine(ary);
        }
    }
}
