#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int ans;
  if (x > y) ans = 2 * x * c;
  if (y > x) ans = 2 * y * c;
  for (int i = 0; i <= x; i++) {
    for (int j = 0; j <= y; j++) {
      if (i - j == x - y and ans > a * i + b * j + 2 * c * (y - j)) {
        ans = a * i + b * j + 2 * c * (y - j);
      }
    }
  }
  cout << ans << endl;
}
