Listting all subdirectories under the input directory path on shell can be done with a command below.
ls -lR <input directory path> | grep '^d'
Here is how to count a number of all subdirectories by a command below.
ls -lR <input directory path> | grep '^d' | wc -l
To list all files under the input directory is here.
ls -lR <input directory path>
To count a number of all the files under the input directoy with a command below.
ls -lR <input directory path> | wc -l