#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;
ll dx[6]={-1,0,0,1,0,0},dy[6]={0,-1,0,0,1,0},dz[6]={0,0,-1,0,0,1};
ll a,b,c,n;
set<PP> s;

ll calc(ll x,ll y,ll z) {
  if(s.count(PP(x,P(y,z)))>0)return -1;
  if(x<0||x>=a||y<0||y>=b||z<0||z>=c) return -1;
  return 1;
}

int main() {
  cin >> a >> b >> c >> n;
  ll ans=(a*b+b*c+c*a)*2;
  while(n--) {
    ll xx,yy,zz;
    cin >> xx >> yy >> zz;
    if(s.count(PP(xx,P(yy,zz)))) continue;
    for(ll i=0; i<6; i++) {
      ll x=xx+dx[i],y=yy+dy[i],z=zz+dz[i];
      ans+=calc(x,y,z);
    }
    s.insert(PP(xx,P(yy,zz)));
  }
  cout << ans << endl;
  return 0;
}