The entire package is a cube, so its volume is 8 x 8 x 8 = 512 in^3. Each small cube is 1 x 1 x 1 = 1 in^3. Therefore, there are 512 in^3 / 1 in^3 = 512 cubes, and since each cube is 25 cents, it would cost (512 cubes)($0.25) = $128 to buy all the cubes in the carton.