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

class Program
{
    static void Main(string[] args)
    {
        // 入力
        long[] abcxy = Console.ReadLine().Split().Select(long.Parse).ToArray();
        var a = abcxy[0];
        var b = abcxy[1];
        var c = abcxy[2];
        var d = abcxy[3];
        var e = abcxy[4];

        // ABピザを使わない場合
        var ans = a * d + b * e;

        // ABピザを使う場合
        if (a > c)
        {
            var tmp = c * d * 2;
            if (e > d)
            {
                tmp += b * (e - d);
            }
            ans = Math.Min(ans, tmp);
        }

        if (b > c)
        {
            var tmp = c * e * 2;
            if (d > e)
            {
                tmp += a * (d - e);
            }
            ans = Math.Min(ans, tmp);

        }

        if (a > c && b > c)
        {
            if (d > e)
            {
                ans = Math.Min(ans, c * d * 2);
            }
            else
            {
                ans = Math.Min(ans, c * e * 2);
            }

        }


        Console.WriteLine(ans);
    }
}
