count done along with group by and custom print