A grocery store had a total of w bottles of which x were bottles of regular soda and the rest were bottles of diet soda. They also had y apple. How many bottles of diet soda did they have?
There are a total of w = 17 bottles. 

x = 9 of those bottles are regular soda. 

That means that the rest, or w - x, are diet soda. 

So, w - x = 8 bottles of diet soda.