You work it backwards.
-- If there were 4 children and each child got 4 pieces,
then the children got (4 x 4) = 16 pieces altogether.
-- That's what was left after he took 2 pieces for himself.
So he started with (16 + 2) = <em>18 pieces</em>.
I hope the solution in pic helps you