#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, C, X, Y;
  long long int sum, left;
  long long int min = 500000000;
  cin >> A >> B >> C >> X >> Y;
  if (A / 2 + B / 2 <= C) {
    cout << A * X + B * Y << "\n";
  } else {
    if (X < Y) {
      sum = C * X * 2;
      left = Y - X;
      for (int i = 0; i <= left; i++) {
        int left_sum = i * B + (left - i) * C * 2;
        if (left_sum < min) {
          min = left_sum;
        }
      }
      cout << sum + min << "\n";
    } else {
      sum = C * Y * 2;
      left = X - Y;
      for (int i = 0; i <= left; i++) {
        int left_sum = i * A + (left - i) * C * 2;
        if (left_sum < min) {
          min = left_sum;
        }
      }
      cout << sum + min << "\n";
    }
  }
  return 0;
}
