a, b, c, n = gets.split.map(&:to_i)
s = 2 * (a * b +  b * c + c * a)
removed = {}
n.times do
    x, y, z = gets.split.map(&:to_i)
    s += x > 0     && !removed[[x - 1, y, z]] ? 1 : -1
    s += x < a - 1 && !removed[[x + 1, y, z]] ? 1 : -1
    s += y > 0     && !removed[[x, y - 1, z]] ? 1 : -1
    s += y < b - 1 && !removed[[x, y + 1, z]] ? 1 : -1
    s += z > 0     && !removed[[x, y, z - 1]] ? 1 : -1
    s += z < c - 1 && !removed[[x, y, z + 1]] ? 1 : -1
    removed[[x, y, z]] = 1
end
p s

