#include <bits/stdc++.h>
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dr[4] = {-1, 0, 1, 0};
const int dc[4] = {0, 1, 0, -1};
const int INF = 1e9;
int guki(int a) {
  if (a % 2 == 0)
    return 0;
  else
    return 1;
}
int gcd(int a, int b) {
  if (a % b == 0) {
    return b;
  } else {
    return (gcd(b, a % b));
  }
}
int lcm(int a, int b) {
  int x = gcd(a, b);
  return (a * b / x);
}
using namespace std;
int main() {
  int a, b, ab, x, y;
  cin >> a >> b >> ab >> x >> y;
  int k = max(x, y);
  int ans = INF;
  for (int i = 0; i <= k; i += 2) {
    int q = max(0, x - i);
    int w = max(0, y - i);
    ans = min(ans, a * q + b * w + i * ab * 2);
  }
  cout << ans << endl;
}
