#include <bits/stdc++.h>
using namespace std;
long long bin(long long bina) {
  long long ans = 0;
  for (long long i = 0; bina > 0; i++) {
    ans = ans + (bina % 2) * pow(10, i);
    bina = bina / 2;
  }
  return ans;
}
bool prime(long long n) {
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return false;
  }
  return n != 1;
}
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x * y / gcd(x, y); }
long long jo(long long n) {
  long long ans = 1;
  for (long long i = 0; i < n; ++i) {
    ans *= 2;
  }
  return ans;
}
signed main() {
  long long a, b, c, s, d;
  cin >> a >> b >> c >> s >> d;
  if (a + b <= c * 2) {
    cout << a * s + b * d << endl;
  } else if (a + b > c * 2) {
    cout << c * max(s, d) * 2 << endl;
  } else {
    cout << c * min(s, d) * 2 + abs(s - d) * a << endl;
  }
}
