#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
  long long int A, B, C, D, E, L, R, X, Y, W, H, N, M, K, sum = 0, num = 0,
                                                          flag = 0;
  string S, T;
  cin >> A >> B >> C >> X >> Y;
  K = (A + B) / 2;
  if (C < K) {
    sum += 2 * C * min(X, Y);
    num = min(X, Y);
  }
  sum += A * (X - num) + B * (Y - num);
  cout << sum << endl;
}
