#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, ab;
  cin >> a >> b >> ab;
  int x, y;
  cin >> x >> y;
  int money = 0;
  if (a >= 2 * ab) {
    y -= min(x, y);
    money += 2 * ab * x;
    x = 0;
  }
  if (b >= 2 * ab) {
    money += 2 * ab * y;
    y = 0;
  }
  if (a + b >= 2 * ab) {
    int m = min(x, y);
    x -= m;
    y -= m;
    money += 2 * ab * m;
  }
  money += a * x + b * y;
  cout << money << endl;
}
