#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, x, y;
  long long need = 0, api = 0, bpi = 0;
  cin >> a >> b >> c >> x >> y;
  if ((a + b) / 2 <= c) {
    while ((api < x) && (bpi < y)) {
      need += a + b;
      api++;
      bpi++;
    }
  } else {
    while ((api < x) && (bpi < y)) {
      need += c * 2;
      api++;
      bpi++;
    }
  }
  if (bpi < y) {
    if (c < b / 2) {
      while (bpi < y) {
        need += c;
        bpi += 2;
      }
    } else {
      while (bpi < y) {
        need += b;
        bpi += 1;
      }
    }
  } else if (api < x) {
    if (c < a / 2) {
      while (api < x) {
        need += c;
        api += 2;
      }
    } else {
      while (api < x) {
        need += a;
        api += 1;
      }
    }
  }
  cout << need << endl;
  return 0;
}
