#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e, f = 0;
  cin >> a >> b >> c >> d >> e;
  if (a + b <= c * 2) f = f + a * d + b * e;
  if (a + b > c * 2) {
    if (d <= e) f = d * 2 * c + f + b * (e - d);
    if (d > e) f = e * 2 * c + f + a * (d - e);
  }
  cout << f;
  return 0;
}
