#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int min1 = 0;
  if (x >= y)
    for (int i = 0; i < y / 2; i += 2) {
      int x1 = x + i / 2;
      int y1 = y + i / 2;
      for (int j = 0; j < x; ++j) {
        for (int k = 0; k < x; ++k) {
          int sum = i * c + j * a + k * b;
          if (x == x1 && y == y1) {
            min1 = min(min1, sum);
          }
        }
      }
    }
  if (x <= y)
    for (int i = 0; i < x / 2; i += 2) {
      int x1 = x + i / 2;
      int y1 = y + i / 2;
      for (int j = 0; j < x; ++j) {
        for (int k = 0; k < x; ++k) {
          int sum = i * c + j * a + k * b;
          if (x == x1 && y == y1) {
            min1 = min(min1, sum);
          }
        }
      }
    }
  cout << min1 << endl;
}
