#include <bits/stdc++.h>
using namespace std;
const int MAX = 999999999;
long long min_val = MAX;
void dfs(int a, int b, int c, int x, int y, long long sum) {
  if (x <= 0 && y <= 0) {
    min_val = min(min_val, sum);
    return;
  }
  if (x > 0) dfs(a, b, c, 0, y, sum + a * x);
  if (y > 0) dfs(a, b, c, x, 0, sum + b * y);
  if (x > 0 || y > 0)
    dfs(a, b, c, x - max(x, y), y - max(x, y), sum + c * max(x, y));
}
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  c *= 2;
  dfs(a, b, c, x, y, 0);
  cout << min_val << endl;
}
