Counting anf filtering entities