Hello!
We can write this as the system of equations below. We have boxes A, B, and C.
A+B+C=9
B=A+1
C=B+1
First of all we can plug our B and C values into the first equation and solve for A.
A+A+1+A+1+1=9
3a+3=9
3a=6
a=2
Now we can plug our a value into the other equations.
B=2+1
B=3
C=3+1
C=4
Therefore, there are 2 rocks in one box, three in another, and 4 in the last.
I hope this helps!