#include <bits/stdc++.h>
using namespace std;
int main() {
  int A = 0;
  int B = 0;
  int C = 0;
  int X = 0;
  int Y = 0;
  int cost = 0;
  cin >> A >> B >> C >> X >> Y;
  int min = A * X + B * Y;
  int cx = X;
  int cy = Y;
  int n = min;
  for (int Z = 0; X > 0 || Y > 0; Z++) {
    int temp = min;
    if (X > 0 && Y > 0) {
      temp = n + (2 * C * Z);
      if (temp < min) min = temp;
    } else if (X > 0) {
      temp = n + (2 * C * Z);
      if (temp < min) min = temp;
    } else if (Y > 0) {
      temp = n + (2 * C * Z);
      if (temp < min) min = temp;
    }
    if (X > 0) {
      n -= A;
      X--;
    }
    if (Y > 0) {
      n -= B;
      Y--;
    }
  }
  cout << min;
}
