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