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