let q, h, s, d = Scanf.scanf " %d %d %d %d" @@ fun a b c d -> a, b, c, d
let n = Scanf.scanf " %d" @@ (+) 0
let m0_5 = min h @@ q * 2
let m1 = min s @@ m0_5 * 2
let m2 = min d @@ m1 * 2
let c2 = n / 2
let c1 = n - c2 * 2
let _ = c2 * m2 + c1 * m1 |> Printf.printf "%d\n"