#include <bits/stdc++.h>
using namespace std;
int sub(int a, vector<char> b, int c, int d) {
  if (c % 2019 == 0 && c != 0) return 1;
  return sub(a + 1, b, c + b[d] * a, d + 1);
}
int main() {
  long long int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  if (c * 2 <= a + b) {
    if (max(d, e) == d) {
      if (c * 2 >= a)
        cout << c * 2 * e + a * (d - e);
      else
        cout << c * 2 * d;
    } else {
      if (c * 2 >= b)
        cout << c * 2 * e + b * (e - d);
      else
        cout << c * 2 * e;
    }
  } else
    cout << a * d + b * e;
}
