Add new function for counting directories and files in given path.