#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) {
  if (a < b) swap(a, b);
  if (b == 0)
    return a;
  else
    return GCD(b, a % b);
}
int main() {
  int A, B, C, X, Y, i;
  long long ans = 9223372036854775807, sum;
  cin >> A >> B >> C >> X >> Y;
  for (i = 0; i < (min(X, Y) + 1); ++i) {
    sum = C * 2 * i + A * max(0, (X - i)) + B * max(0, (Y - i));
    ans = min((long long)sum, ans);
  }
  cout << ans << endl;
}
