Explanation:
the box is
9 in × 3.5 in × 4.5 in = 141.75 in³
each block is
0.5 in × 0.5 in × 0.5 in = 0.125 in³ (1/8 in³)
so, we can fit
141.75 / 0.125 = 1134
blocks into the box.
and they fit neatly, as the dimensions of the box and the cubes allow a tight packing without any empty left over space in the box.