#include <bits/stdc++.h>
using namespace std;
struct pizza {
  float n;
  float p;
} a, b;
int main() {
  float ab, xa, xb, m, l;
  while (~scanf("%f %f %f %f %f", &a.p, &b.p, &ab, &a.n, &b.n)) {
    float p = 0;
    if (a.n <= b.n) {
      p = b.p;
      l = b.n - a.n;
    } else {
      p = a.p;
      l = a.n - b.n;
    }
    m = 0;
    if (a.p <= ab && b.p <= ab)
      m = a.n * a.p + b.n * b.p;
    else if (ab <= a.p && ab <= b.p) {
      if (ab * 2 <= a.p && ab * 2 <= b.p)
        m = 2 * ab * max(a.n, b.n);
      else
        m = ab * min(a.n, b.n) * 2 + l * p;
    } else {
      xa = ab - a.p;
      xb = ab - b.p;
      if (xa + xb <= 0)
        m = ab * min(a.n, b.n) * 2 + l * p;
      else
        m = a.n * a.p + b.n * b.p;
    }
    printf("%.0f\n", m);
  }
  return 0;
}
