#include <bits/stdc++.h>
using namespace std;
int main() {
  long long A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  long long ans = 1e9 + 1;
  for (int c = 0; c <= 2 * max(X, Y); c += 2) {
    ans = min(ans, X * (A - c / 2) + Y * (B - c / 2) + c * C);
  }
  cout << ans << endl;
  return 0;
}
