#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
long long A, B, C, X, Y;
int main() {
  cin >> A >> B >> C >> X >> Y;
  long long ans = INF;
  long long limit = max(A / 2, B / 2);
  for (int i = 0; i <= limit; i += 2) {
    long long cost = 0;
    long long half = i / 2;
    cost += i * C;
    cost += max(X - half, 0LL) * A;
    cost += max(Y - half, 0LL) * B;
    ans = min(ans, cost);
  }
  cout << ans << endl;
}
