Count the number of parameters and then the same number of directories