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