#include <bits/stdc++.h>
using namespace std;
int A, B, C;
int X, Y;
int main() {
  scanf("%lld%lld%lld", &A, &B, &C);
  scanf("%lld%lld", &X, &Y);
  long long ans = 1001001001001001;
  for (int i = 0; i <= 200000; i += 2) {
    long long res = C * i;
    res += max(0, X - i / 2) * A;
    res += max(0, Y - i / 2) * B;
    ans = min(res, ans);
  }
  printf("%lld\n", ans);
  return 0;
}
