function main(input) {
	var r = input.split(/\s/)[0];
  	var g = input.split(/\s/)[1];
  	var b = input.split(/\s/)[2];
  	var n = input.split(/\s/)[3];
  	var result = 0;
  	while (n + 2 >= 1) {
    	resurut *= n;
      	n--;
    }
  	console.log(result);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
