Example

Input

2 2 2 1
0 0 0


Output

24
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define int long long


signed main(){
  int a,b,c,n;
  cin>>a>>b>>c>>n;
  vector<int> x(n),y(n),z(n);
  int ans=0;
  ans+=(a*b);
  ans+=(a*c);
  ans+=(b*c);
  ans*=2;
  int num=0;
  num=(n*6);
  rep(i,n){
    int aa,bb,cc;
    cin>>aa>>bb>>cc;
    if(aa==0) num-=2;
    if(bb==0) num-=2;
    if(cc==0) num-=2;
    if(aa==a-1) num-=2;
    if(bb==b-1) num-=2;
    if(cc==c-1) num-=2;
    x[i]=aa;
    y[i]=bb;
    z[i]=cc;
  }
  rep(i,n){
    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){
        num-=2;
      }
    }
  }
  ans+=num;
  cout<<ans<<endl;

}

