object Main extends App {
	val temp = scala.io.StdIn.readLine.split(" ").map(_.toLong)
	val N = scala.io.StdIn.readLong

	val Q = temp(0)
	val H = temp(1)
	val S = temp(2)
	val D = temp(3)

	var a1 = Array(S,H*2L,H+Q*2L,Q*4L).min
	var a2 = Array(D,a1*2L).min

	if(N%2L == 0){
		println(a2 * (N/2L))
	}else{
		println(a1 + a2 * ((N-1L)/2L))
	}

}