By a $(k,l,m)$-cuboid I mean this:
I would like to know the number $c(k,l,m)$ of steps, when inverting this cuboid completely.
As an example, let $(k,l,m)=(2,2,2)$. If we start inverting this step by step starting in the upper right front, we get a directed graph like this:
I'm interested in the number of vertices of this graph in the general case. In the above case, it should be 20. I figured out that the formula
should hold (and similarly for the other two directions), but I'm pretty sure that there is a nicer recursion. Note that the case $m=1$ is just the binomial coefficient $\binom{k+l}{k}$.

