while(<>){chomp;map{$h{$_}++}split //} for(sort(keys(%h))){printf("$_:%3d\n", $h{$_})}