#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y;
  int cnt = 0;
  int kari = 0;
  int kari2 = 0;
  cin >> a >> b >> c >> x >> y;
  if (c * 2 < a + b) {
    for (int i = 0; true; i++) {
      cnt += c * 2;
      x--;
      y--;
      if (x == 1 && y <= 0) {
        kari += a;
        x--;
      }
      if (x <= 0 && y == 1) {
        kari += b;
        y--;
      }
      if ((x <= 0 && y == 1) || (x == 1 && y <= 0)) {
        kari2 += c * 2;
      }
      if (cnt + kari2 < cnt + kari)
        cnt += kari2;
      else
        cnt += kari;
      if (x <= 0 && y <= 0) break;
    }
    cout << cnt << endl;
  } else {
    for (int i = 0; true; i++) {
      cnt += a + b;
      x--;
      y--;
      if (x == 1 && y <= 0) {
        cnt += a;
        x--;
      }
      if (x <= 0 && y == 1) {
        cnt += b;
        y--;
      }
      if (x <= 0 && y <= 0) break;
    }
    cout << cnt << endl;
  }
}
