There are several ways you can accomplish this:
Creating a File list (createFileList) will allow you to point to the root folder, then add a Recursive view. This will traverse all folders (below the root) and return a list of files. An optional variable is the Number of files found. This will give you the TOTAL number of files (in all folders).
To separate by sub-folder, you would have to loop through (forEach) the FileList variable and check for a change in the file attribute "parentFile" (This is the current folder of each file as you loop through.) Create a counter and then you would have the number of files in each folder.
Another way is to use a Folder List. This is detailed with a Forum Post Here
Creating your folder list would allow you to loop through that rowset of Folder Names, then do a CreatFileList inside each folder to generate the number of files in each.
There are other options as well ... these are just a couple.