#include <bits/stdc++.h>
int main() {
  int a, b, c;
  int x, y;
  scanf("%d%d%d", &a, &b, &c);
  scanf("%d,%d", &x, &y);
  int min = a * x + b * y;
  if (a < b) {
    int cnt = 0;
    for (int i = x; i >= 0; i--) {
      int hoge = a * (x - cnt) + b * (y - cnt) + c * cnt * 2;
      if (hoge < min) min = hoge;
      cnt++;
    }
  } else {
    int cnt = 0;
    for (int i = y; i >= 0; i--) {
      int hoge = a * (x - cnt) + b * (y - cnt) + c * cnt * 2;
      if (hoge < min) min = hoge;
      cnt++;
    }
  }
  printf("%d\n", min);
  return 0;
}
