#include <bits/stdc++.h>
using namespace std;
int A, B, C, X, Y;
int main() {
  scanf("%d %d %d %d %d", &A, &B, &C, &X, &Y);
  int cost = 1000000000;
  for (int i = 0; i <= X; i++) {
    for (int j = 0; j <= Y; j++) {
      int k = 2 * max(X - i, Y - j);
      int AP = i + k / 2;
      int BP = j + k / 2;
      if (AP >= X && BP >= Y) {
        int c = A * i + B * j + C * k;
        if (c < cost) {
          cost = c;
        }
      }
    }
  }
  printf("%d\n", cost);
  return 0;
}
