#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const long long int LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int mod = 1000000007;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int ans = 0;
  for (int i = 0; i < (min(x, y) / 2); i++) {
    int tmp = 2 * c * i + a * (x - c) + b * (y - c);
    (ans = max(ans, tmp));
  }
  cout << ans << endl;
  return 0;
}
