#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, ab, x, y;
  cin >> a >> b >> ab >> x >> y;
  int xcount = 0, count = 0, money = 0;
  if (2 * ab <= a && 2 * ab <= b) {
    while (1) {
      if (count == max(x, y)) break;
      money += 2 * ab;
      count++;
    }
  } else if (2 * ab < a + b) {
    while (1) {
      if (min(x, y) == count) break;
      money += 2 * ab;
      count++;
    }
    int MAX = max(x, y);
    while (max(x, y) != count) {
      count++;
      if (MAX == x)
        money += a;
      else
        money += b;
    }
  } else {
    while (1) {
      if (x == count) break;
      money += a;
      count++;
    }
    count = 0;
    while (y != count) {
      count++;
      money += b;
    }
  }
  cout << money << endl;
  return 0;
}
