#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;

namespace FastFourierTransform
{
	using C = complex< double >;

	void DiscreteFourierTransform(vector< C > &F, bool rev)
	{
		const int N = (int)F.size();
		const double PI = (rev ? -1 : 1) * acos(-1);
		for (int i = 0, j = 1; j + 1 < N; j++) {
			int k=N>>1;
			for (; k > (i ^= k); k >>= 1);
			if (i > j) {
				swap(F[i], F[j]);
			}
		}
		C w, s, t;
		for (int i = 1; i < N; i <<= 1) {
			for (int k = 0; k < i; k++) {
				w = polar(1.0, PI / i * k);
				for (int j = 0; j < N; j += i * 2) {
					s = F[j + k];
					t = C(F[j + k + i].real() * w.real() - F[j + k + i].imag() * w.imag(),
						F[j + k + i].real() * w.imag() + F[j + k + i].imag() * w.real());
					F[j + k] = s + t, F[j + k + i] = s - t;
				}
			}
		}
		if (rev) for (int i = 0; i < N; i++) F[i] /= N;
	}

	vector< long long > Multiply(const vector<long long int > &A, const vector<long long int > &B)
	{
		int sz = 1;
		while (sz <= A.size() + B.size()) sz <<= 1;
		vector< C > F(sz), G(sz);
		for (int i = 0; i < A.size(); i++) F[i] = A[i];
		for (int i = 0; i < B.size(); i++) G[i] = B[i];
		DiscreteFourierTransform(F, false);
		DiscreteFourierTransform(G, false);
		for (int i = 0; i < sz; i++) F[i] *= G[i];
		DiscreteFourierTransform(F, true);
		vector< long long > X(A.size() + B.size() - 1);
		for (int i = 0; i < A.size() + B.size() - 1; i++) X[i] = F[i].real() + 0.5;
		return (X);
	}
};

int main()
{
	long long	int A,B,C;cin>>A>>B>>C;

	vector<long long int>lens{ A,B,C };
	int Q;cin>>Q;
	long long int ans=0;
	vector<tuple<int,int,int>>vs;
	for (int i = 0; i < Q; ++i) {
		int a,b,c;cin>>a>>b>>c;
		vs.emplace_back(a,b,c);
	}
	 ans=2*(A*B+B*C+C*A);

	for (int i = 0; i < Q; ++i) {
		ans+=6;

		auto t1=vs[i];
		vector<int>z1{ get<0>(t1),get<1>(t1),get<2>(t1) };

		for (int k = 0; k < 3; ++k) {
			if(z1[k]==0)ans-=2;
			if(z1[k]+1==lens[k])ans-=2;
		}
		for (int j = i+1; j < Q; ++j) {
			auto t2=vs[j];

			vector<int>z2{ get<0>(t2),get<1>(t2),get<2>(t2) };

			int num1=0,num0=0;
			for (int k = 0; k < 3; ++k) {
				int x=abs(z1[k]-z2[k]);
				if(x==0)num0++;
				if(x==1)num1++;
			}
			if (num1 == 1 && num0 == 2) {
				ans-=2;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}

