A dog of mass 10 kg is standing on a flat 10 m long boat so that is 20 meters from the shore. It walks 8 m on the boat towards the shore and then stops. The mass of the boat is 40 kg and friction between the boat and the water surface is negligible. How far is the dog from the shore now? Please explain.