Counting with weights