calculate the total amount spent
calculate the total amount spent