#include <bits/stdc++.h>
using namespace std;
int main() {
  bool satu = 0, dua = 0;
  long long sisa = 0;
  long long ans = 0;
  int same;
  long long a, b, ab;
  int need_a, need_b;
  cin >> a >> b >> ab >> need_a >> need_b;
  same = min(need_a, need_b);
  if (need_a * a + need_b * b > ab * same * 2) {
    ans = ab * same * 2;
  } else {
    ans = need_a * a + need_b * b;
  }
  if (same != need_a || same != need_b) {
    if (same == need_a) {
      sisa = need_b - same;
      dua = 1;
    } else {
      sisa = need_a - same;
      satu = 1;
    }
    if (satu == 1) {
      if (sisa * a < sisa * ab * 2) {
        ans += sisa * a;
      } else {
        ans += sisa * ab * 2;
      }
    } else if (dua == 1) {
      if (sisa * b < sisa * ab * 2) {
        ans += sisa * b;
      } else {
        ans += sisa * ab * 2;
      }
    }
  }
  if (ab * max(need_a, need_b) * 2 < ans) {
    ans = ab * max(need_a, need_b) * 2;
  }
  cout << ans << endl;
  return 0;
}
