Calculating the number of combinations