#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, AB;
  cin >> A >> B >> AB;
  int X, Y;
  cin >> X >> Y;
  int H = A * X + B * Y;
  int I = AB * 2 * max(X, Y);
  int K = min(H, I);
  int F = 0;
  int G = 0;
  for (int i = 0; i <= X; i++) {
    int j = max(X - i, Y);
    F = A * i + AB * j * 2;
    if (G == 0) {
      G = F;
    } else {
      G = min(min(G, F), K);
    }
  }
  cout << G << endl;
}
