how many directories and files are there in a directory

I want to know how many directories and files are there in a directory and if the sub directory have any files i also need that also .
I have done this far ....

Use find with -type f or d and then use wc ...

No external commands are necessary:

set -- *
numfiles=$#
set -- */
numdirs=$#

printf "%13s: %d\n" Files "$(( $numfiles - $numdirs ))" Directories "$numdirs"

EDIT: I missed the requirement for counting subdiretories.

numfiles=$( find "$DIR" -type f | wc -l )
numdirs=$( find "$DIR" -type d | wc -l )
printf "%13s: %d\n" Files "$numfiles" Directories "$numdirs"
One way is to walk the tree.  First pass finds all the directories,
then we count all the files and directories under each directory.
Grossly inefficient on a deep tree ... but short to code.

#!/bin/ksh
(
find . -type d -print|while read SUBDIR
do
        COUNTER=$(find "${SUBDIR}" -print|wc -l)
        echo "${SUBDIR} : ${COUNTER}"
done
) 2>&1 | pg

cfajohnson and myself are placing different interpretation on the phrase "directories and files". Which is right?
On this forum an example of input and expected output is useful.