#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  long long m, n, sum = 0;
  cin >> a >> b >> c >> m >> n;
  if (a + b <= c * 2) sum = a * m + b * n;
  if ((a + b > c * 2) && (2 * c >= a) && (2 * c >= b)) {
    if (m >= n)
      sum = sum + 2 * n * c + (m - n) * a;
    else
      sum = sum + 2 * m * c + (n - m) * b;
  }
  if ((a + b > c * 2) && ((2 * c < a) || (2 * c < b))) {
    if (m > n)
      sum = sum + 2 * m * c;
    else
      sum = sum + 2 * n * c;
  }
  cout << sum << endl;
  return 0;
}
