Example

Input

2 2 2 1
0 0 0


Output

24
#define _USE_MATH_DEFINES
 
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
 
using namespace std;
 
typedef pair<long long int, long long int> P;
long long int INF = 1e18;

int main(){
	
	long long int A, B, C, N;
	cin >> A >> B >> C >> N;
	
	long long int x[1100], y[1100], z[1100];
	
	for(int i = 0; i < N; i++){
		cin >> x[i] >> y[i] >> z[i];
	}
	
	long long int ans = (A * B + B * C + C * A) * 2 + 6 * N;
	
	for(int i = 0; i < N; i++){
		if(x[i] == 0){
			ans -= 2;
		}
		if(y[i] == 0){
			ans -= 2;
		}
		if(z[i] == 0){
			ans -= 2;
		}
		if(x[i] == A - 1){
			ans -= 2;
		}
		if(y[i] == B - 1){
			ans -= 2;
		}
		if(z[i] == C - 1){
			ans -= 2;
		}
		for(int j = i + 1; j < N; j++){
			if(abs(x[i] - x[j]) + abs(y[i] - y[j]) + abs(z[i] - z[j]) <= 1){
				ans -= 2;
			}
		}
	}
	
	cout << ans << endl;
	
	return 0;
}
