#JavaScript (ES6), <s> 73 65 </s> 64 bytes <!-- language-all: lang-javascript --> (x,y,z)=>(g=n=>!n||g(n-1)/(s=n%z-~(n/z%y)+n/z/y%x|0)*-~s)(x*y*z) [Try it online!](https://tio.run/##bc1BDoIwFATQvafABcn/2FpacOGi3IUgEI35NdYY2hCuXrtCAmQWs3jJzKP@1rZ5318fTubWhk4HGJhjHnUFvSZdHWkceyAuUYDVlHo@AQmfOjzFEi4dxhwzPlmEIXOZx9AYsubZnp@mhw4ki0FMhEh0lajDVtWsxUYVK2aV@YojLqZ3uZy5vK496uJ7zwt2@c@XUqrwAw "JavaScript (Node.js) – Try It Online") ###Commented (x, y, z) => ( // (x, y, z) = input g = n => // g is a recursive function taking a counter n !n || // if n = 0, stop recursion and return 1 g(n - 1) / ( // otherwise, divide the result of a recursive call by: s = // s defined as the sum of: n % z // k, 0-indexed: n mod z - ~(n / z % y) // j, 1-indexed: floor((n / z) mod y) + 1 + n / z / y % x | 0 // i, 0-indexed: floor((n / z / y) mod x) ) // * -~s // and multiply by s + 1 )(x * y * z) // initial call to g with n = x * y * z