Counting the number of possibilities