#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
using namespace std;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int ans = a * x + b * y;
  cout << ans << endl;
  for (int i = 0; i < 200001; i += 2) {
    int tmp_x = x - i / 2;
    int tmp_y = y - i / 2;
    int sum = a * max(tmp_x, 0) + b * max(tmp_y, 0) + c * i;
    ans = min(ans, sum);
  }
  cout << ans << endl;
  return 0;
}
