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