#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535897932;
const double EPS = 1e-15;
const int INF = 1001001001;
const long long mod = 1e+9 + 7;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  long long res = 0;
  if (c <= a && c <= b) {
    res += c * min(x, y) * 2;
    res += c * (max(x, y) - min(x, y)) * 2;
  } else {
    if (2 * c <= a + b) {
      res += c * min(x, y) * 2;
      if (max(x, y) - min(x, y) != 0) {
        if (min(x, y) == x) {
          if (c <= b) {
            res += c * (max(x, y) - min(x, y)) * 2;
          } else {
            res += b * (max(x, y) - min(x, y));
          }
        } else {
          if (c <= a) {
            res += c * (max(x, y) - min(x, y)) * 2;
          } else {
            res += a * (max(x, y) - min(x, y));
          }
        }
      }
    } else {
      res += a * x + b * y;
      long long hoge;
      if (c <= a) {
        hoge = c * x * 2 + max(b * (y - x / 2), 0ll);
      } else if (c <= b) {
        hoge = max(0ll, a * (x - y / 2)) + c * y * 2;
      }
      res = min(res, hoge);
    }
  }
  cout << res << endl;
}
