move along the diagonal, parameterizing our movement by a number t that runs from 0 at one corner to 1 at the opposite corner.
we enter a new cube every time one of 81t, 125t, 128t crosses an integer. These all happen at different times except that at the very start (t=0) all three happen together but we are entering only a single cube.
So the total number of cubes is
81+125+128-2 = 332.
Here's another way of saying it that some may find more congenial:
Consider the planes, parallel to the sides of the cuboid, that divide it into those cubes. As we travel from one corner to the other, we enter a new cube every time we cross one of those planes. There are 80+124+127=331 planes in all; plus the one cube in which we start, for a total of 332 cubes.