#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  int x, y;
  int ans = 0;
  cin >> a >> b >> c >> x >> y;
  if (a + b >= c * 2) {
    while (x != 0 || y != 0) {
      ans += c * 2;
      x--;
      y--;
    }
    cout << ans + abs(a * x) + abs(b * y) << endl;
  } else {
    cout << a * x + y * b << endl;
  }
  return 0;
}
