import java.util.*;
import java.io.*;

//Задача "Painting"
//8 Персональная ИО сезона 2008/2009 - базовый уровень
//Автор задачи: Владимир Ульянцев, sinica239@gmail.com
//Автор решения: Маским Носенко, nosenkomax@gmail.com
// Не отсортировали размеры

public class painting_mn_wrong1 implements Runnable {

	public static void main(String args[]) {
		new Thread(new painting_mn_wrong1()).start();
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	private String FNAME = "painting";
	boolean eof = false;

	@Override
	public void run() {
		try {
			Locale.setDefault(Locale.US);
			br = new BufferedReader(new FileReader(FNAME + ".in"));
			out = new PrintWriter(FNAME + ".out");
			solve();
			br.close();
			out.close();

		} catch (Exception e) {
			e.printStackTrace();
			System.exit(566);
		}
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}

	void My_Assert(boolean b, String s) {
		if (!b)
			throw new Error("Assertion " + s);
	}

	private void solve() {
		int a = nextInt(), b = nextInt(), c = nextInt(), k = nextInt();
		My_Assert(1 <= a && a <= 100, "w is out of range: " + a);
		My_Assert(1 <= b && b <= 100, "h is out of range: " + b);
		My_Assert(1 <= c && c <= 100, "l is out of range: " + c);
		My_Assert(0 <= k && k <= 6, "k is out of range: " + k);

//		if (a > b) {
//			int t = a;
//			a = b;
//			b = t;
//		}
//		if (b > c) {
//			int t = c;
//			c = b;
//			b = t;
//		}
//		if (a > b) {
//			int t = a;
//			a = b;
//			b = t;
//		}

		if (a == 0) {
			out.println(0);
			return;
		}

		int t = 0;

		switch (k) {
		case 0:
			if (a > 1)
				t = (a - 2) * (b - 2) * (c - 2);
			break;
		case 1:
			if (a > 1)
				t = 2 * ((a - 2) * (b - 2) + (c - 2) * (b - 2) + (a - 2)
						* (c - 2));
			break;
		case 2:
			if (a > 1)
				t = 4 * (a - 2 + b - 2 + c - 2);
			else if (b > 1)
				t = (b - 2) * (c - 2);
			break;
		case 3:
			if (a > 1)
				t = 8;
			else if (b > 1)
				t = 2 * (b - 2 + c - 2);
			break;
		case 4:
			if (a == 1)
				if (b > 1)
					t = 4;
				else if (c > 1)
					t = c - 2;
			break;
		case 5:
			if (b == 1)
				if (c > 1)
					t = 2;
			break;

		case 6:
			if (c == 1)
				t = 1;
			break;

		}
		out.println(t);
	}
}