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