Example

Input

2 2 2 1
0 0 0


Output

24
/*  -*- coding: utf-8 -*-
 *
 * 2723.cc: Surface Area of Cubes
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 1000;
const int dxs[] = { 1, -1, 0,  0, 0,  0 };
const int dys[] = { 0,  0, 1, -1, 0,  0 };
const int dzs[] = { 0,  0, 0,  0, 1, -1 };

/* typedef */

typedef long long ll;

struct pt {
  int x, y, z;
  pt() {}
  pt(int _x, int _y, int _z): x(_x), y(_y), z(_z) {}
  bool operator<(const pt &p) const {
    return x < p.x || (x == p.x && (y < p.y || (y == p.y && z < p.z)));
  }
};

typedef set<pt> spt;

/* global variables */

/* subroutines */

inline bool inside(int x, int y, int z, int a, int b, int c) {
  return (x >= 0 && x < a && y >= 0 && y < b && z >= 0 && z < c);
}

/* main */

int main() {
  int a, b, c, n;
  scanf("%d%d%d%d", &a, &b, &c, &n);

  ll ar = ((ll)a * b + (ll)b * c + (ll)c * a) * 2;
  spt cbs;

  for (int i = 0; i < n; i++) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);

    for (int di = 0; di < 6; di++) {
      int vx = x + dxs[di], vy = y + dys[di], vz = z + dzs[di];
      if (inside(vx, vy, vz, a, b, c) &&
	  cbs.find(pt(vx, vy, vz)) == cbs.end())
	ar++;
      else
	ar--;
    }

    cbs.insert(pt(x, y, z));
  }

  printf("%lld\n", ar);
  return 0;
}