Count sentences instead of lines; sort and remove duplicates before outputting