#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include "Boolean.h"
#include "Complex.h"
#include "IdNo.h"
#include "VipMember.h"
#include "SeniorMember.h"
#include "Shape.h"
#include "Point.h"
#include "Rectangle.h"
#include "HorzLine.h"
#include "VertLine.h"
#include "Line.h"
//#include <bits/stdc++.h>

using namespace std;

int main()
{	
	int a, b, c, x, y;
	cin >> a >> b >> c >> x >> y;

	int ans = INT_MAX;
	for (int i = 0; i <= 100000; i++)
	{
		ans = min(ans, i * 2 * c + max(0, x - i) * a + max(0, y - i) * b);
	}
	cout << ans << endl;
}