#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  int sum = 0;
  int n, m;
  cin >> a >> b >> c >> n >> m;
  if (n > m) {
    if (c <= (a + b) / 2) {
      sum += c * 2 * m;
      sum += a * (n - m);
      cout << sum << endl;
    } else {
      sum += a * n;
      sum += b * m;
      cout << sum << endl;
    }
  } else {
    if (c <= (a + b) / 2) {
      sum += c * 2 * n;
      sum += b * (m - n);
      cout << sum << endl;
    } else {
      sum += a * n;
      sum += b * m;
      cout << sum << endl;
    }
  }
}
