Example

Input

2 2 2 1
0 0 0


Output

24
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef double Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<int,string> tp;
//typedef vector<tp> vt;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e9;
const ll INF=2e18;
int dx[]={-1,1,0,0,0,0};
int dy[]={0,0,-1,1,0,0};
int dz[]={0,0,0,0,-1,1};
//int dx[]={0,1,0,-1};
//int dy[]={1,0,-1,0};
int main(){
	ll x,y,z,n;
	cin>>x>>y>>z>>n;
	vvi in(n,vi(3));
	rep(i,n)rep(j,3)cin>>in[i][j];
	ll out=2*x*y+2*y*z+2*z*x;
	rep(i,n)rep(j,6){
		int a=in[i][0]+dx[j];
		int b=in[i][1]+dy[j];
		int c=in[i][2]+dz[j];
		if(a<0||a>=x||b<0||b>=y||c<0||c>=z){
			out--;
		}else{
			bool h=false;
			rep(k,n)if(in[k][0]==a&&in[k][1]==b&&in[k][2]==c){
				h=true;
			}
			if(!h)out++;
		}
	}
	
	cout<<out<<endl;
}