The counting principle states that if there are m ways to do one thing and n ways to do another thing, then there are m × n ways to do both things. In this situation, there are 18 different flavors of yogurt to choose from each time you visit the shop. Since you visit the shop three times, the size of the sample space is 18 × 18 × 18 = 5832.
This means that there are 5832 different possible outcomes for the flavors you could choose over your three visits.