#include <bits/stdc++.h>
using namespace std;
const int INF = 100000000;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
  int i, j, k, l, m, n, sum, A, B, C, Y, flag, N, M, X, H, W;
  k = 0;
  sum = 0;
  cin >> A >> B >> C >> X >> Y;
  if (2 * C <= A + B) {
    if (2 * C > A && 2 * C > B) {
      if (X > Y) {
        cout << Y * 2 * C + A * (X - Y) << endl;
      } else {
        cout << X * 2 * C + B * (Y - X) << endl;
      }
    } else if (2 * C <= A && 2 * C > B) {
      if (X > Y) {
        cout << X * 2 * C << endl;
      } else {
        cout << X * 2 * C + B * (Y - X) << endl;
      }
    } else if (2 * C <= B && 2 * C > A) {
      if (X > Y) {
        cout << Y * 2 * C + A * (X - Y) << endl;
      } else {
        cout << Y * 2 * C << endl;
      }
    } else {
      cout << fmax(X, Y) * C * 2 << endl;
    }
  } else {
    cout << A * X + B * Y << endl;
  }
  flag = 0;
  return 0;
}
