#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
using ll = long long;
int main() {
  int A, B, AB, X, Y;
  cin >> A >> B >> AB >> X >> Y;
  int ans = INT_MAX;
  for (int i = 0; i < (int)(1000001); i++) {
    ans = min(ans, AB * i * 2 + max(0, (X - i)) * A + max(0, (Y - i)) * B);
  }
  cout << ans << endl;
}
