Count only Files or Folders but not both.

Is there a way to count only sub-files or only subfolders but not both? I am trying to label folders that have fewer than 100 files but no subfolders. This is to avoid processing folders that have only a couple of subfolders which in turn could have many more files.