#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
const long long MOD = 1000000007;
int main(void) {
  long long a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  vector<int> ans = {};
  ans.push_back(a * x + b * y);
  ans.push_back(4 * c * (max(x, y) / 2 + max(x, y) % 2));
  ans.push_back(4 * c * (min(x, y) / 2) + a * (x - 2 * (min(x, y) / 2)) +
                b * (y - 2 * (min(x, y) / 2)));
  sort(ans.begin(), ans.end());
  cout << ans[0] << "\n";
}
