Given the task definition and input, reply with output. The task is to generate the correct answer for a given math problem.

Problem: carolyn bought 17 gumballs , lew bought 12 gumballs , and carey bought x gumballs . the average ( arithmetic mean ) number of gumballs the 3 bought is between 19 and 25 , inclusive . what is the difference between the greatest number and the smallest number of gumballs carey could have bought ?
18