Read this article for another example of this type of a general statement problem. In this problem, it looks like there are two variables. However, we can relate the quantity of one variable to that of the other. This allows us to write the equation in terms of only one variable.
At the bottom of the page, try a few practice problems and check your answers. Try a couple of these until you feel comfortable writing and solving equations from general word problems.