This is a problem based on concept of first law of thermodynamics
if a body is giving heat it will be absorbed by some other body or surrounding.
Now we have taken metal at low temperature and water at high temperature
So water will lose some energy and the same amount of energy will be gained by metal. The exchange will continue untill both reach the same temperature.
So answer is
The energy gained by the metal equals the energy lost by the water.