main();

function main() {
  var readline = require('readline');
  var reader = readline.createInterface({
      input: process.stdin,
      output: process.stdout
  });
  var lines = [];
  reader.on('line', function (line) {
    lines.push(line);
  });
  reader.on('close', function () {
    var prices   = lines[0].split(/ /);
    var buyLiter = parseInt(lines[1]);
    console.log(caclMinimumMoney(prices, buyLiter));
  });

}

function caclMinimumMoney(prices, buyLiter) {
  var liters = [0.25, 0.5, 1, 2];
  var costs = {};
  for(var i = prices.length - 1; i >= 0; i--) {
    var price = prices[i];
    var liter = liters[i];

    // コスパが良い順に並ぶ
    costs[parseInt(price) / parseFloat(liter)] = {price: price, liter: liter};
  }

  var pay = 0;
  for(var key in costs) {
    var liter = costs[key].liter;
    var price = costs[key].price;

    while (buyLiter >= liter) {
      buyLiter = parseFloat(buyLiter) - parseFloat(liter);
      pay      = parseInt(pay)        + parseInt(price);
    }
  }

  return pay;
}
