#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int uq(int div, int mod) {
  if (mod == 0) {
    return div;
  }
  return uq(mod, (div % mod));
}
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int ABCnt = 0;
  int sum = 0;
  if (a + b >= 2 * c) {
    ABCnt = min(a, b) * 2;
    sum += ABCnt * c;
    sum += (max(a, b) - ABCnt) * max(a, b);
  } else {
    sum += a * x;
    sum += b * y;
  }
  cout << sum << endl;
  return 0;
}
