Processing integers with the sort_by_count() function