#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, x, y, p;
  cin >> a >> b >> c >> x >> y;
  if (a + b <= 2 * c)
    p = a * x + b * y;
  else if (a >= 2 * c && b >= 2 * c)
    p = max(x, y) * 2 * c;
  else if (a >= 2 * c)
    p = 2 * c * x + max(y - 2 * c, (long long)0) * b;
  else if (b >= 2 * c)
    p = max(x - 2 * c, (long long)0) + 2 * c * y;
  else if (a + b >= 2 * c)
    p = min(x, y) * 2 * c + max(x - min(x, y), (long long)0) * a +
        max(y - min(x, y), (long long)0) * b;
  cout << p << endl;
}
