#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
bool isPrime(long long x) {
  int i;
  if (x < 2)
    return false;
  else if (x == 2)
    return true;
  if (x % 2 == 0) return false;
  for (i = 3; i * i <= x; i += 2)
    if (x % i == 0) return false;
  return true;
}
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int mx = 2000000000;
  for (int i = 0; i <= max(x, y); i += 2) {
    mx = min(mx, max(a * (x - i), 0) + max(b * (y - i), 0) + c * 2 * i);
  }
  cout << mx << endl;
}
