Example

Input

2 2 2 1
0 0 0


Output

24
#include <stdio.h>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
#include <cctype>


template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//constexpr long long MAX = 5100000;
constexpr long long INF = 1LL << 60;
constexpr int inf = 1000000007;
constexpr long long mod = 1000000007LL;
//constexpr long long mod = 998244353LL;
const long double PI = acos((long double)(-1));

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;


int dx[] = { 1,-1,0,0,0,0 };
int dy[] = { 0,0,1,-1,0,0 };
int dz[] = { 0,0,0,0,1,-1 };
int main()
{

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	ll a, b, c, n; cin >> a >> b >> c >> n;
	ll res = (a * b + b * c + c * a) * 2;
	vector<tuple<ll, ll, ll>> vt(n);
	for (int i = 0; i < n; i++) {
		ll x, y, z; cin >> x >> y >> z;
		vt[i] = make_tuple(x, y, z);
	}
	sort(vt.begin(), vt.end());
	for (auto p : vt) {
		ll x, y, z; tie(x, y, z) = p;
		for (int i = 0; i < 6; i++) {
			ll nx = x + dx[i];
			ll ny = y + dy[i];
			ll nz = z + dz[i];
			bool ok = true;
			if (nx < 0 or nx >= a or ny < 0 or ny >= b or nz < 0 or nz >= c) res--;
			else if (!binary_search(vt.begin(), vt.end(), make_tuple(nx, ny, nz))) res++;
			
		}
	}
	cout << res << endl;
}

