import 'dart:io';

void main() {
  List input =
      stdin.readLineSync().split(" ").map((x) => int.parse(x)).toList();
  int a = input[0];
  int b = input[1];
  int c = input[2];
  int x = input[3];
  int y = input[4];
  List sumList = [];

  for (int i = 0; i <= x * 2; i++) {
    for (int j = 0; j <= y * 2; j++) {
      for (int k = 0; k < x * 2 + y * 2; k++) {
        if (k % 2 == 1) continue;
        if (k / 2 < x - i) continue;
        if (k / 2 < y - j) continue;
        if (i + k / 2 >= x && j + k / 2 >= y) {
          int sum = a * i + b * j + c * k;
          // print("$sum,$i,$j,$k");
          sumList.add(sum);
        }
      }
    }
  }
  List sortS = sumList..sort((a, b) => a.compareTo(b));
  print(sortS[0]);
}