const rec = (db, N, price, f) => {
  if(db.length === 0){
    return
  } 
  const a = db.pop()
  const n = a.n
  const p = a.p
  for(; N>0; N-=n, price+=p){
    rec(db, N, price, f)
  }
  if(N === 0){
    f(price)
  }
}

const solve = input => {
  const z = input.split("\n").slice(0,2)
  const [Q, H, S, D] = z[0].split(' ').slice(0, 4).map(s => parseInt(s))
  const N = parseInt(z[1])
  const db = [[0.25, Q], [0.5, H], [1, S], [2, D]].map(x => 0||{ n:x[0], p:x[1] })

  let pool = []
  rec(db, N, 0, p=>pool.push(p))
  console.log(Math.min(...pool))
}
//p=process.stdin;p.resume();p.setEncoding('utf8');p.on('data',x=>{ solve(x.toString())})