#include <bits/stdc++.h>
using namespace std;
const int INF = 111111111;
const long long LLINF = 1e17 + 1;
const int DX[9] = {0, 0, 1, -1, 1, 1, -1, -1, 0};
const int DY[9] = {1, -1, 0, 0, 1, -1, 1, -1, 0};
const int DIV = 1000000007;
const double PI = 3.14159265358979323846264338327950288;
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  if (A + B <= 2 * C) {
    cout << A * X + B * Y;
  } else if (A > 2 * C || B > 2 * C) {
    cout << C * 2 * max(X, Y);
  } else {
    cout << C * 2 * min(X, Y) + A * (X - min(X, Y)) + B * (Y - min(X, Y));
  }
}
