#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  int min = A * X + B * Y;
  for (int i = 0; i <= X; i++) {
    for (int j = 0; j <= Y; j++) {
      for (int k = 0; k <= max(A, B) * 2; k += 2) {
        if (i + k / 2 >= X && j + k / 2 >= Y) {
          if (min > A * i + C * k / 2 + B * j + C * k / 2) {
            min = A * i + C * k / 2 + A * j + C * k / 2;
          }
        }
      }
    }
  }
  cout << min << endl;
}
