#include <bits/stdc++.h>
using namespace std;
unsigned long long min(unsigned long long x, unsigned long long y) {
  if (x > y) return y;
  return x;
}
unsigned long long max(unsigned long long x, unsigned long long y) {
  if (x < y) return y;
  return x;
}
int main() {
  unsigned long long A, B, C, X, Y;
  unsigned long long res = 0;
  cin >> A >> B >> C >> X >> Y;
  int minim;
  if (C < (A + B) / 2) {
    minim = min(X, Y);
    res = minim * C * 2;
    X -= minim;
    Y -= minim;
    if (X != 0) {
      if (C < A / 2)
        res += X * C * 2;
      else
        res += X * A;
    } else if (Y != 0) {
      if (C < B / 2)
        res += Y * C * 2;
      else
        res += Y * B;
    }
  } else {
    res = X * A;
    res += Y * B;
  }
  cout << res;
}
