The upper and lower fences define the interval on which a data value isn't considered an outlier. In this case, if the element has a value less that the lower fence , then its an outlier; and if the element has a value greater than the upper fence , then it is an outlier.
In your data set, only two values are considered outliers. The first is 16 because it has a value less than the lower fence . The second is 31 because it has a value greater than the upper fence .
The numbers 18 and 30 have nothing to do with the number of elements, but it deals with the value of the elements.