#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  int a, b, ab;
  cin >> a >> b >> ab;
  int x, y;
  cin >> x >> y;
  ll ans = x * a + y * b;
  if (ab * max(x, y) * 2 < ans) {
    ans = ab * max(x, y) * 2;
  }
  ll com = 0;
  if (x % 2 == 1) {
    com = 1 * a;
    x--;
  }
  if (y % 2 == 1) {
    com = 1 * b;
    y--;
  }
  com += ab * max(x, y) * 2;
  if (com < ans) {
    ans = com;
  }
  cout << ans << endl;
}
