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