#include <iostream>
#include <iomanip>

#include <cstdlib>
#include<algorithm>//排序sort()
using namespace std;


int main()
{
    int a,b,c,x,y;
    cin>>a>>b>>c>>x>>y;
    int  sum=0;
    if(2 * c >= b + a)
    {
        sum = x * a + y * b;
        cout<<sum;
        return 0;
    }
    else if(2 * c < a && 2 * c < b)
    {
        x > y ? cout<< 2 * x * c : cout << 2 * y *c;
        return 0;
    }
    else{
        int rest,min;//cha
        x > y ? min=y : min=x;
        if(min % 2 == 0) //ou
        {
            sum+= 2*min * c;
            if(x >= y)
            {
                sum+= (x-y) * a;
                cout<<sum;
                return 0;
            } else{
                sum +=(y-x) *b;
                cout<<sum;
                return 0;
            }
        }
        else{//ji
            sum+=(min-1)*c;
            if(x >= y)
            {
                sum+= (1+x-y) * a + b;
                cout<<sum;
                return 0;
            } else{
                sum +=(1+y-x) * b + a;
                cout<<sum;
                return 0;
            }
        }
    }

	return 0;
}