Write a bash script to count the number of directories