That was a first draft, the main purpose was to give the original poster an idea on how the qn could be solved. Also the OP didn't make much sence so I took it as count the number of times each letter occurs w/n the string. Also I could not be bothered counting the characters w/n the string, so just chose an arbitary number instead, still works.
In response to tolower: woops, that can be corrected, but one can still guess what I was trying to do. Still hope it helps w/ understanding.