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