obtained count of each category.printed it in respective div.