Example

Input

2 2 2 1
0 0 0


Output

24
#include<bits/stdc++.h>
using namespace std;

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int dx[6]={0,0,0,0,-1,1};
int dy[6]={0,0,-1,1,0,0};
int dz[6]={-1,1,0,0,0,0};

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

    int ans=(A*B+B*C+C*A)*2;

    set<tuple<int,int,int>>rem;
    rep(i,N){
        int x,y,z;
        cin>>x>>y>>z;
        rem.insert(make_tuple(x,y,z));
    }

    for(auto &latte:rem){
        int x,y,z;
        tie(x,y,z)=latte;
        rep(d,6){
            int nx=x+dx[d],ny=y+dy[d],nz=z+dz[d];
            if(nx<0||nx>=A||ny<0||ny>=B||nz<0||nz>=C)ans--;
            else{
                if(rem.find(make_tuple(nx,ny,nz))==rem.end())ans++;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}