#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  if (a + b <= 2 * c) {
    cout << a * x + b * y << endl;
    return 0;
  }
  if ((x >= y && a > (2 * c)) || (y > x && b > (2 * c))) {
    if (x >= y) {
      cout << 2 * x * c << endl;
    } else {
      cout << 2 * y * c << endl;
    }
    return 0;
  }
  int a_slices, b_slices, c_slices;
  a_slices = x > y ? x - y : 0;
  b_slices = y > x ? y - x : 0;
  c_slices = x > y ? y * 2 : x * 2;
  cout << a_slices << endl;
  cout << b_slices << endl;
  cout << c_slices << endl;
  cout << a_slices * a + b_slices * b + c_slices * c << endl;
  return 0;
}
