#include <bits/stdc++.h>
struct pizza {
  std::size_t v, n;
  pizza(std::size_t v_, std::size_t n_) : v{v_}, n{n_} {}
};
int main() {
  std::size_t A, B, C, X, Y;
  std::cin >> A >> B >> C >> X >> Y;
  pizza a(A, X), b(B, Y);
  int total = 0;
  if (a.v + b.v < C * 2) {
    total += a.v * a.n;
    total += b.v * b.n;
  }
  if (a.v < 2 * C && b.v < 2 * C && 2 * C < a.v + b.v) {
    auto mm = std::minmax(X, Y);
    total += mm.first * 2 * C;
    total += (mm.second - mm.first) * (X < Y ? B : A);
  }
  if (2 * C < A && 2 * C < B) {
    total += std::max(X, Y) * C * 2;
  }
  if (2 * C < a.v && !(2 * C < b.v)) {
    bool a_b = a.n <= b.n;
    if (a_b) {
      total += a.n * C * 2 + (b.n - a.n) * b.v;
    } else {
      total += a.n * C * 2;
    }
  }
  if (!(2 * C < a.v) && 2 * C < b.v) {
    total += b.n * C * 2 * b.n <= a.n ? (a.n - b.n) * a.v : 0;
  }
  std::cout << total << "\n";
  return 0;
}
