#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
using pint = pair<int, int>;
using itn = int;
using vint = vector<int>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return a * b / gcd(a, b);
}
int main() {
  ll a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  if (a + b <= c * 2) {
    cout << 1 << endl;
    cout << a * x + b * y << endl;
  } else if (a <= c * 2 && b <= c * 2) {
    cout << 2 << endl;
    cout << min(x, y) * c * 2 + (x - min(x, y)) * a + (y - min(x, y)) * b
         << endl;
  } else if (a > c * 2 && b > c * 2) {
    cout << 3 << endl;
    cout << max(x, y) * c * 2 << endl;
  } else if (a > c * 2) {
    cout << 4 << endl;
    cout << x * c * 2 + max(0ll, y - x) * b << endl;
  } else {
    cout << 5 << endl;
    cout << y * c * 2 + max(0ll, x - y) * a << endl;
  }
  return 0ll;
}
