#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;
long long a, b, c, x, y;
long long pyen(long long x, long long y) {
  if (x > y)
    return a;
  else
    return b;
}
int main() {
  cin >> a >> b >> c >> x >> y;
  if (a < c && b < c) cout << a * x + b * y << endl;
  if (a > c && b > c) cout << 2 * c * max(x, y) << endl;
  if ((a <= c && c <= b) || (b <= c && c <= a))
    cout << min(a * x + b * y, 2 * c * min(x, y) + abs(x - y) * pyen(x, y))
         << endl;
  return 0;
}
