Example

Input

2 2 2 1
0 0 0


Output

24
#define  _CRT_SECURE_NO_WARNINGS
#pragma comment (linker, "/STACK:526000000")

#include "bits/stdc++.h"

using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL

#define MOD 998244353LL
#define seg_size 262144 * 4LL
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

void init() {
	iostream::sync_with_stdio(false);
	cout << fixed << setprecision(20);
}

#define int ll

void solve() {
	int a, b, c, n;
	cin >> a >> b >> c >> n;
	int dx[6] = { 1,-1,0,0,0,0 };
	int dy[6] = { 0,0,1,-1,0,0 };
	int dz[6] = { 0,0,0,0,1,-1 };
	vector<tuple<int,int, int>> neko;
	set<tuple<int,int, int>> next;
	REP(i, n) {
		int a, b, c;
		cin >> a >> b >> c;
		neko.push_back(make_tuple(a, b, c));
	}
	int ans = a * b + b*c + a * c;
	ans *= 2LL;
	REP(i, n) {
		next.insert(neko[i]);
		int cnt = 0;
		REP(q, 6) {
					int x = dx[q] + get<0>(neko[i]);
					int y = dy[q] + get<1>(neko[i]);
					int z = dz[q] + get<2>(neko[i]);
					if (x >= 0 && x < a && y >= 0 && y < b && z >= 0 && z < c) {
						cnt += next.count(make_tuple(x, y, z));
					}
					else {
						cnt++;
					}
		}
		ans += 6 - 2 * cnt;
	}
	cout << ans << endl;
}

#undef int
int main() {
	init();
	solve();
}
