#include <bits/stdc++.h>
int max(int a, int b) { return a < b ? b : a; }
int main() {
  int a, b, c, x, y, ans = 1000000000000000;
  scanf("%d%d%d%d%d", &a, &b, &c, &x, &y);
  for (int i = 0; i <= 100000; i++) {
    int price = a * max(x - c, 0) + b * max(y - c, 0) + i * 2 * c;
    if (price < ans) ans = price;
  }
  printf("%d\n", ans);
  return 0;
}
