#include <bits/stdc++.h>
using namespace std;
int A = 1500, B = 2000, C = 1600, X = 3, Y = 2;
int answer = 1000000000, ans;
int rec(int counta, int countb, int countc) {
  if (counta + countc / 2 < X && countb + countc / 2 < Y)
    min(rec(counta + 1, countb + 1, countc), rec(counta, countb, countc + 2));
  else if (counta + countc / 2 < X)
    min(rec(counta + 1, countb, countc), rec(counta, countb, countc + 2));
  else if (countb + countc / 2 < Y)
    min(rec(counta, countb + 1, countc), rec(counta, countb, countc + 2));
  else {
    answer = min(answer, counta * A + countb * B + countc * C);
  }
}
int main() {
  cin >> A >> B >> C >> X >> Y;
  rec(0, 0, 0);
  cout << answer << endl;
}
