The box starts with x notes. (the money value is never important)
-----------------------------------------
He takes \(\frac{x}{3}+2 = \frac{x+6}{3}\)
and leaves \(\frac{2x}{3}-2=\frac{2x-6}{3}\\\)
----------------------------------------
from the ones left
he takes \(\frac{1}{2}*\frac{2x-6}{3}+2=\frac{x-3}{3}+\frac{6}{3}=\frac{x+3}{3}\\ \)
and leaves \(\frac{x-3}{3}-\frac{6}{3}=\frac{x-9}{3}\)
---------------------------------------
from the ones left
he takes \(\frac{1}{2}*\frac{x-9}{3}+2\)
and leaves ...
AND you should be able to take it from there