#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;
  if (C < min(A, B) / 2) {
    res = max(X, Y) * 2 * C;
  } else {
    if (C < (A + B) / 2) {
      res = min(X, Y) * C * 2;
      if (X > Y) {
        res += (X - Y) * A;
      } else {
        res += (Y - X) * B;
      }
    } else {
      res = X * A + Y * B;
    }
  }
  cout << res;
}
