#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
using ull = unsigned long long;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int main() {
  int A, B, AB, X, Y;
  cin >> A >> B >> AB >> X >> Y;
  if (2 * AB < A + B) {
    int min_n = min(X, Y);
    cout << min_n * 2 * AB + (X - min_n) * A + (Y - min_n) * B << endl;
  } else {
    cout << A * X + B * Y << endl;
  }
}
