Calculating costs or total expenses