#include<iostream>
#include<set>
using namespace std;
long a,b,c;
int n;
long ans;
int main()
{
	cin>>a>>b>>c>>n;
	ans=2*a*b+2*b*c+2*c*a;
	set<pair<int,pair<int,int> > >S;
	for(;n--;)
	{
		int x,y,z;cin>>x>>y>>z;
		int cnt=!x+!y+!z+(x==a-1)+(y==b-1)+(z==c-1);
		cnt+=S.find(make_pair(x-1,make_pair(y,z)))!=S.end();
		cnt+=S.find(make_pair(x+1,make_pair(y,z)))!=S.end();
		cnt+=S.find(make_pair(x,make_pair(y-1,z)))!=S.end();
		cnt+=S.find(make_pair(x,make_pair(y+1,z)))!=S.end();
		cnt+=S.find(make_pair(x,make_pair(y,z-1)))!=S.end();
		cnt+=S.find(make_pair(x,make_pair(y,z+1)))!=S.end();
		ans+=6-cnt*2;
		S.insert(make_pair(x,make_pair(y,z)));
	}
	cout<<ans<<endl;
}

