Another method would be:-
ls -lC1R | sed -e '/.*:\|^$/d' | sort | uniq -c
This will provide the information you require in this format:-
where the first field is the number of occurences and the second field is the file/dir name.
It will not differentiate between files and directories, so if you want to do this check out "man ls" for file listing options. This is probably a good idea, otherwise if you have a file called "dog" and a directory called "dog" it will count them both in the same line.
When you format the output I would suggest putting something between the file name and the number of occurences, otherwise if you have a listing with "pic123", for example, how would you know if it is 3 x "pic12" or 23 x "pic1" or even 123 x "pic"?