#include <bits/stdc++.h>
int main(void) {
  int a, b, c, x, y;
  int val = 0;
  scanf("%d%d%d%d%d", &a, &b, &c, &x, &y);
  if (a + b < c * 2) {
    while (x * y) {
      x--, y--;
      val += a + b;
    }
    if (x == 0 && b < c * 2) {
      val += b * y;
    } else if (y == 0 && a < c * 2) {
      val += a * x;
    } else {
      val += (c * 2) * (x + y);
    }
  } else {
    while (x * y) {
      x--, y--;
      val += c * 2;
    }
    if (x == 0 && b < c * 2) {
      val += b * y;
    } else if (y == 0 && a < c * 2) {
      val += a * x;
    } else {
      val += (c * 2) * (x + y);
    }
  }
  printf("%d", val);
  return 0;
}
