import std.algorithm;
import std.array;
import std.conv;
import std.stdio;
import std.string;

void main ()
{
	long [] a;
	while ((a = readln.splitter.map !(to !(long)).array) != [])
	{
		auto n = readln.strip.to !(long);
		foreach (i, c; a)
		{
			if (i > 0)
			{
				a[i] = min (a[i], a[i - 1] * 2);
			}
		}
		writeln (a[3] * (n / 2) + a[2] * (n % 2));
	}
}
