Example

Input

2 2 2 1
0 0 0


Output

24
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll a,b,c,n,i,j,k=0;
  cin>>a>>b>>c>>n;
  ll x[n],y[n],z[n];
  for(i=0;i<n;i++) cin>>x[i]>>y[i]>>z[i];
  for(i=0;i<n;i++)
    for(j=i+1;j<n;j++)
      k+=((abs(x[i]-x[j])+abs(y[i]-y[j])+abs(z[i]-z[j]))==1);
  for(i=0;i<n;i++){
    if(x[i]==0) k++;
    if(x[i]==a-1) k++;
    if(y[i]==0) k++;
    if(y[i]==b-1) k++;
    if(z[i]==0) k++;
    if(z[i]==c-1) k++;
  }
  cout << 2*(a*b+b*c+c*a)+6*n-k*2 << endl;
  return 0;
}