Sum of money for specific purpose

I was given money for a specific purpose. I only used a portion of the money for that purpose. Do i need to give maaser on the whole amount or just the money that I didn’t use? Thanks.

The money not used for thst purpose