#include <bits/stdc++.h>
using namespace std;
int a, b, c, x, y, a1, a2, b1, b2, sum, tmp;
int main(void) {
  scanf("%d%d%d%d%d", &a, &b, &c, &x, &y);
  sum = 0;
  c *= 2;
  a1 = x / 2 * 2;
  b1 = y / 2 * 2;
  a2 = x - a1;
  b2 = y - b1;
  tmp = min(a2, b2);
  sum = min(c * max(a1, b1), a * a1 + b * b1);
  if (a + b > c) {
    sum += c * tmp;
    sum += min(a, c) * (a2 - tmp) + min(a, b) * (b2 - tmp);
  } else {
    sum += a * a2 + b * b2;
  }
  printf("%d\n", sum);
  return 0;
}
